atomicFile
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 atomicFile(
p: Path,
sub_path: []const u8,
options: fs.Dir.AtomicFileOptions,
buf: *[fs.max_path_bytes]u8,
) !fs.AtomicFile {
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.atomicFile(joined_path, options);
}