* Fix #20628 for Windows * Move isRegular - !isSpecial and onlyRegular - skipSpecial * Forgot to change it in 1 more place
This commit is contained in:
parent
e68a6ea759
commit
779b1cc5be
7 changed files with 41 additions and 38 deletions
|
|
@ -86,16 +86,16 @@ type
|
|||
|
||||
when defined(posix) and not weirdTarget:
|
||||
proc getSymlinkFileKind*(path: string):
|
||||
tuple[pc: PathComponent, isRegular: bool] =
|
||||
tuple[pc: PathComponent, isSpecial: bool] =
|
||||
# Helper function.
|
||||
var s: Stat
|
||||
assert(path != "")
|
||||
result = (pcLinkToFile, true)
|
||||
result = (pcLinkToFile, false)
|
||||
if stat(path, s) == 0'i32:
|
||||
if S_ISDIR(s.st_mode):
|
||||
result = (pcLinkToDir, true)
|
||||
result = (pcLinkToDir, false)
|
||||
elif not S_ISREG(s.st_mode):
|
||||
result = (pcLinkToFile, false)
|
||||
result = (pcLinkToFile, true)
|
||||
|
||||
proc tryMoveFSObject*(source, dest: string, isDir: bool): bool {.noWeirdTarget.} =
|
||||
## Moves a file (or directory if `isDir` is true) from `source` to `dest`.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue