Fix for unix and solaris
This commit is contained in:
parent
48ef6761d8
commit
1f641b1337
1 changed files with 5 additions and 6 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue