Function symLinkAbsolute [src]

Creates a symbolic link named sym_link_path which contains the string target_path. A symbolic link (also known as a soft link) may point to an existing file or to a nonexistent one; the latter case is known as a dangling link. If sym_link_path exists, it will not be overwritten. See also symLinkAbsoluteZ and symLinkAbsoluteW. On Windows, both paths should be encoded as WTF-8. On WASI, both paths should be encoded as valid UTF-8. On other platforms, both paths are an opaque sequence of bytes with no particular encoding.

Prototype

pub fn symLinkAbsolute( target_path: []const u8, sym_link_path: []const u8, flags: Dir.SymLinkFlags, ) !void

Parameters

target_path: []const u8sym_link_path: []const u8flags: Dir.SymLinkFlags

Source

pub fn symLinkAbsolute( target_path: []const u8, sym_link_path: []const u8, flags: Dir.SymLinkFlags, ) !void { assert(path.isAbsolute(target_path)); assert(path.isAbsolute(sym_link_path)); if (native_os == .windows) { const target_path_w = try windows.sliceToPrefixedFileW(null, target_path); const sym_link_path_w = try windows.sliceToPrefixedFileW(null, sym_link_path); return windows.CreateSymbolicLink(null, sym_link_path_w.span(), target_path_w.span(), flags.is_directory); } return posix.symlink(target_path, sym_link_path); }