From 6421b7b8b281a38b1fda0a422ef4990e8d5323e4 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 10 Dec 2020 09:41:09 +0000 Subject: RFE 548cd945d6: symlinks for Windows 10 --- win/tclWinFile.c | 13 +++++++++---- 1 file 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); } -- cgit v0.12