mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-18 21:40:32 +00:00
Fix for unix and solaris
This commit is contained in:
@@ -1015,21 +1015,20 @@ proc rawCreateDir(dir: string): bool =
|
||||
# Returns `true` if the directory was created, `false` if it already exists.
|
||||
when defined(solaris):
|
||||
let res = mkdir(dir, 0o777)
|
||||
case res
|
||||
of 0'i32:
|
||||
if res == 0'i32:
|
||||
result = true
|
||||
of EEXIST, ENOSYS:
|
||||
elif errno in {EEXIST, ENOSYS}:
|
||||
result = false
|
||||
else:
|
||||
raiseOSError(osLastError())
|
||||
elif defined(unix):
|
||||
let res = mkdir(dir, 0o777)
|
||||
case res
|
||||
of 0'i32:
|
||||
if res == 0'i32:
|
||||
result = true
|
||||
of EEXIST:
|
||||
elif errno == EEXIST:
|
||||
result = false
|
||||
else:
|
||||
echo res
|
||||
raiseOSError(osLastError())
|
||||
else:
|
||||
when useWinUnicode:
|
||||
|
||||
Reference in New Issue
Block a user