From 0d07117a65c001720d7b210b104abd427f2feaca Mon Sep 17 00:00:00 2001 From: Charlie Barto Date: Tue, 29 Aug 2017 02:30:57 -0400 Subject: [PATCH] allow non-admins to create symlinks on windows (#6287) --- lib/pure/os.nim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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)