diff options
author | Charlie Barto <bartoc@umich.edu> | 2017-08-29 02:30:57 -0400 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2017-08-29 08:30:57 +0200 |
commit | 0d07117a65c001720d7b210b104abd427f2feaca (patch) | |
tree | 0955e49edac668fd6cdc92b11d6098d15fece484 | |
parent | 920f4acadfabb7c426f272f8a57d08276eb1264e (diff) | |
download | Nim-0d07117a65c001720d7b210b104abd427f2feaca.tar.gz |
allow non-admins to create symlinks on windows (#6287)
-rw-r--r-- | lib/pure/os.nim | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/pure/os.nim b/lib/pure/os.nim index 2195f6327..bdf9813f9 100644 --- a/lib/pure/os.nim +++ b/lib/pure/os.nim @@ -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) |