summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-12-10 09:41:09 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-12-10 09:41:09 (GMT)
commit6421b7b8b281a38b1fda0a422ef4990e8d5323e4 (patch)
treed4d410b13688ad223f2ecc9cae125c3446dd6483 /win
parent20e0998a323f571ddb5f5aaf9789dcc8fa6b06b7 (diff)
downloadtcl-6421b7b8b281a38b1fda0a422ef4990e8d5323e4.zip
tcl-6421b7b8b281a38b1fda0a422ef4990e8d5323e4.tar.gz
tcl-6421b7b8b281a38b1fda0a422ef4990e8d5323e4.tar.bz2
RFE 548cd945d6: symlinks for Windows 10
Diffstat (limited to 'win')
-rw-r--r--win/tclWinFile.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/win/tclWinFile.c b/win/tclWinFile.c
index 6cfeae1..9c2d14c 100644
--- a/win/tclWinFile.c
+++ b/win/tclWinFile.c
@@ -264,11 +264,16 @@ WinLink(
TclWinConvertError(GetLastError());
} else if (linkAction & TCL_CREATE_SYMBOLIC_LINK) {
- /*
- * Can't symlink files.
- */
+ if (CreateSymbolicLinkW(linkSourcePath, linkTargetPath,
+ 0x2 /* SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE */)) {
+ /*
+ * Success!
+ */
- Tcl_SetErrno(ENOTDIR);
+ return 0;
+ }
+
+ TclWinConvertError(GetLastError());
} else {
Tcl_SetErrno(ENODEV);
}