applies #322 without FReadDir effect
This commit is contained in:
parent
d1d20e5760
commit
180ab350dc
2 changed files with 9 additions and 1 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -16,6 +16,7 @@ compiler/c2nim/nimcache
|
||||||
compiler/pas2nim/nimcache
|
compiler/pas2nim/nimcache
|
||||||
misc
|
misc
|
||||||
doc/*.html
|
doc/*.html
|
||||||
|
doc/*.pdf
|
||||||
doc/*.idx
|
doc/*.idx
|
||||||
/web/upload
|
/web/upload
|
||||||
koch
|
koch
|
||||||
|
|
|
||||||
|
|
@ -1103,8 +1103,15 @@ proc createDir*(dir: string) {.rtl, extern: "nos$1", tags: [FWriteDir].} =
|
||||||
## The full path is created. If this fails, `EOS` is raised. It does **not**
|
## The full path is created. If this fails, `EOS` is raised. It does **not**
|
||||||
## fail if the path already exists because for most usages this does not
|
## fail if the path already exists because for most usages this does not
|
||||||
## indicate an error.
|
## indicate an error.
|
||||||
|
var omitNext = false
|
||||||
|
when defined(doslike):
|
||||||
|
omitNext = isAbsolute(dir)
|
||||||
for i in 1.. dir.len-1:
|
for i in 1.. dir.len-1:
|
||||||
if dir[i] in {dirsep, altsep}: rawCreateDir(substr(dir, 0, i-1))
|
if dir[i] in {dirsep, altsep}:
|
||||||
|
if omitNext:
|
||||||
|
omitNext = false
|
||||||
|
else:
|
||||||
|
rawCreateDir(substr(dir, 0, i-1))
|
||||||
rawCreateDir(dir)
|
rawCreateDir(dir)
|
||||||
|
|
||||||
proc copyDir*(source, dest: string) {.rtl, extern: "nos$1",
|
proc copyDir*(source, dest: string) {.rtl, extern: "nos$1",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue