Merge pull request #2707 from rbehrends/fix-getfileinfo-links
Fix behavior of os.getFileInfo() for symbolic links.
This commit is contained in:
commit
ce2756dd89
1 changed files with 2 additions and 2 deletions
|
|
@ -2033,10 +2033,10 @@ proc getFileInfo*(path: string, followSymlink = true): FileInfo =
|
||||||
else:
|
else:
|
||||||
var rawInfo: TStat
|
var rawInfo: TStat
|
||||||
if followSymlink:
|
if followSymlink:
|
||||||
if lstat(path, rawInfo) < 0'i32:
|
if stat(path, rawInfo) < 0'i32:
|
||||||
raiseOSError(osLastError())
|
raiseOSError(osLastError())
|
||||||
else:
|
else:
|
||||||
if stat(path, rawInfo) < 0'i32:
|
if lstat(path, rawInfo) < 0'i32:
|
||||||
raiseOSError(osLastError())
|
raiseOSError(osLastError())
|
||||||
rawToFormalFileInfo(rawInfo, result)
|
rawToFormalFileInfo(rawInfo, result)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue