pub fn createDirPath(dir: Dir, io: Io, sub_path: []const u8) CreateDirPathError!void 846
847
848pub fn createDirPath(dir: Dir, io: Io, sub_path: []const u8) CreateDirPathError!void {
_ = try io.vtable.dirCreateDirPath(io.userdata, dir, sub_path, .default_dir);
}
Creates parent directories with default permissions as necessary to ensure
sub_pathexists as a directory.Returns success if the path already exists and is a directory.
This function may not be atomic. If it returns an error, the file system may have been modified.
Fails on an empty path with
error.BadPathNameas that is not a path that can be created.On Windows,
sub_pathshould be encoded as WTF-8. On WASI,sub_pathshould be encoded as valid UTF-8. On other platforms,sub_pathis an opaque sequence of bytes with no particular encoding.Paths containing
..components are handled differently depending on the platform:..are resolved before the path is passed to NtCreateFile, meaning asub_pathlike "first/../second" will resolve to "second" and only a./seconddirectory will be created...are not resolved before the path is passed tomkdirat, meaning asub_pathlike "first/../second" will create both a./firstand a./seconddirectory.See also:
createDirPathStatus