Windows/symlink: Difference between revisions
< Windows
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
== symlinks == | |||
Make directory link | |||
mklink /d <link_name> <target_path> | |||
mklink /d [link] [dest] | |||
== cygwin / msys2 == | |||
Set MSYS to use native symlinks instead of deepcopy (default): | |||
setx /M MSYS "winsymlinks:nativestrict" | setx /M MSYS "winsymlinks:nativestrict" | ||
ln -s <target_path> <link_name> | ln -s <target_path> <link_name> | ||
ln -s [dest] [link] | ln -s [dest] [link] | ||
(doesn't need sudo - I thought it did??) | (doesn't need sudo - I thought it did??) | ||
=== winsymlinks:nativestrict === | |||
Symlinks - MSYS2 | |||
https://www.msys2.org/docs/symlinks/ | |||
'''winsymlinks:nativestrict''' is an option for the CYGWIN or MSYS environment variable that forces symbolic links to be created strictly as native Windows symlinks, failing immediately if a native symlink cannot be created | |||
* No fallback: Unlike winsymlinks:native (which falls back to Cygwin-style/shortcut symlinks on failure) or MSYS2's default winsymlinks:deepcopy (which copies files), nativestrict errors out immediately when native symlink creation fails. | |||
* Where it is set: Configure it via CYGWIN=winsymlinks:nativestrict in Cygwin or MSYS=winsymlinks:nativestrict in MSYS2. | |||
== keywords == | |||
Revision as of 21:21, 23 November 2026
symlinks
Make directory link
mklink /d <link_name> <target_path> mklink /d [link] [dest]
cygwin / msys2
Set MSYS to use native symlinks instead of deepcopy (default):
setx /M MSYS "winsymlinks:nativestrict"
ln -s <target_path> <link_name> ln -s [dest] [link]
(doesn't need sudo - I thought it did??)
winsymlinks:nativestrict
Symlinks - MSYS2 https://www.msys2.org/docs/symlinks/
winsymlinks:nativestrict is an option for the CYGWIN or MSYS environment variable that forces symbolic links to be created strictly as native Windows symlinks, failing immediately if a native symlink cannot be created
- No fallback: Unlike winsymlinks:native (which falls back to Cygwin-style/shortcut symlinks on failure) or MSYS2's default winsymlinks:deepcopy (which copies files), nativestrict errors out immediately when native symlink creation fails.
- Where it is set: Configure it via CYGWIN=winsymlinks:nativestrict in Cygwin or MSYS=winsymlinks:nativestrict in MSYS2.