diff options
Diffstat (limited to 'win/tclWinFile.c')
-rw-r--r-- | win/tclWinFile.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/win/tclWinFile.c b/win/tclWinFile.c index f51d6f5..38edd87 100644 --- a/win/tclWinFile.c +++ b/win/tclWinFile.c @@ -264,11 +264,21 @@ WinLink( TclWinConvertError(GetLastError()); } else if (linkAction & TCL_CREATE_SYMBOLIC_LINK) { - /* - * Can't symlink files. - */ + if (!tclWinProcs.createSymbolicLink) { + /* + * Can't symlink files. + */ + Tcl_SetErrno(ENOTDIR); + } else if (tclWinProcs.createSymbolicLink(linkSourcePath, linkTargetPath, + 0x2 /* SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE */)) { + /* + * Success! + */ - Tcl_SetErrno(ENOTDIR); + return 0; + } + + TclWinConvertError(GetLastError()); } else { Tcl_SetErrno(ENODEV); } |