mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-18 21:40:32 +00:00
allow non-admins to create symlinks on windows (#6287)
This commit is contained in:
committed by
Andreas Rumpf
parent
920f4acadf
commit
0d07117a65
@@ -1184,7 +1184,9 @@ proc createSymlink*(src, dest: string) =
|
||||
## Some OS's (such as Microsoft Windows) restrict the creation
|
||||
## of symlinks to root users (administrators).
|
||||
when defined(Windows):
|
||||
let flag = dirExists(src).int32
|
||||
# 2 is the SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE. This allows
|
||||
# anyone with developer mode on to create a link
|
||||
let flag = dirExists(src).int32 or 2
|
||||
when useWinUnicode:
|
||||
var wSrc = newWideCString(src)
|
||||
var wDst = newWideCString(dest)
|
||||
|
||||
Reference in New Issue
Block a user