| ... | ... | @@ -1720,12 +1720,12 @@ pub const SymlinkFlags = struct { |
| 1720 | 1720 | /// See also `symLinkAbsoluteZ` and `symLinkAbsoluteW`. |
| 1721 | 1721 | pub fn symLinkAbsolute(target_path: []const u8, sym_link_path: []const u8, flags: SymlinkFlags) !void { |
| 1722 | 1722 | if (builtin.os.tag == .wasi) { |
| 1723 | | @compileError("symLink is not supported in WASI"); |
| 1723 | @compileError("symLinkAbsolute is not supported in WASI"); |
| 1724 | 1724 | } |
| 1725 | 1725 | assert(path.isAbsolute(target_path)); |
| 1726 | 1726 | assert(path.isAbsolute(sym_link_path)); |
| 1727 | 1727 | if (builtin.os.tag == .windows) { |
| 1728 | | return os.windows.CreateSymbolicLink(target_path, sym_link_path, flags.is_directory); |
| 1728 | return os.windows.CreateSymbolicLink(sym_link_path, target_path, flags.is_directory); |
| 1729 | 1729 | } |
| 1730 | 1730 | return os.symlink(target_path, sym_link_path); |
| 1731 | 1731 | } |
| ... | ... | @@ -1737,7 +1737,7 @@ pub fn symLinkAbsolute(target_path: []const u8, sym_link_path: []const u8, flags |
| 1737 | 1737 | pub fn symLinkAbsoluteW(target_path_w: [*:0]const u16, sym_link_path_w: [*:0]const u16, flags: SymlinkFlags) !void { |
| 1738 | 1738 | assert(path.isAbsoluteWindowsW(target_path_w)); |
| 1739 | 1739 | assert(path.isAbsoluteWindowsW(sym_link_path_w)); |
| 1740 | | return os.windows.CreateSymbolicLinkW(target_path_w, sym_link_path_w, flags.is_directory); |
| 1740 | return os.windows.CreateSymbolicLinkW(sym_link_path_w, target_path_w, flags.is_directory); |
| 1741 | 1741 | } |
| 1742 | 1742 | |
| 1743 | 1743 | /// Same as `symLinkAbsolute` except the parameters are null-terminated pointers. |
| ... | ... | @@ -1748,7 +1748,7 @@ pub fn symLinkAbsoluteZ(target_path_c: [*:0]const u8, sym_link_path_c: [*:0]cons |
| 1748 | 1748 | if (builtin.os.tag == .windows) { |
| 1749 | 1749 | const target_path_w = try os.windows.cStrToWin32PrefixedFileW(target_path_c); |
| 1750 | 1750 | const sym_link_path_w = try os.windows.cStrToWin32PrefixedFileW(sym_link_path_c); |
| 1751 | | return os.windows.CreateSymbolicLinkW(target_path_w.span().ptr, sym_link_path_w.span().ptr, flags.is_directory); |
| 1751 | return os.windows.CreateSymbolicLinkW(sym_link_path_w.span().ptr, target_path_w.span().ptr, flags.is_directory); |
| 1752 | 1752 | } |
| 1753 | 1753 | return os.symlinkZ(target_path_c, sym_link_path_c); |
| 1754 | 1754 | } |