makeOpenPath
Function parameters
Parameters
Useful to make `Path` a key in `std.ArrayHashMap`.
Types
- TableAdapter
- Useful to make `Path` a key in `std.ArrayHashMap`.
Functions in this namespace
Functions
- fmtEscapeChar
- Deprecated, use double quoted escape to print paths.
- formatEscapeChar
- Deprecated, use double quoted escape to print paths.
Source
Implementation
pub fn makeOpenPath(p: Path, sub_path: []const u8, opts: fs.Dir.OpenOptions) !fs.Dir {
var buf: [fs.max_path_bytes]u8 = undefined;
const joined_path = if (p.sub_path.len == 0) sub_path else p: {
break :p std.fmt.bufPrint(&buf, "{s}" ++ fs.path.sep_str ++ "{s}", .{
p.sub_path, sub_path,
}) catch return error.NameTooLong;
};
return p.root_dir.handle.makeOpenPath(joined_path, opts);
}