mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-18 05:20:31 +00:00
Merge pull request #2707 from rbehrends/fix-getfileinfo-links
Fix behavior of os.getFileInfo() for symbolic links.
This commit is contained in:
@@ -2033,10 +2033,10 @@ proc getFileInfo*(path: string, followSymlink = true): FileInfo =
|
||||
else:
|
||||
var rawInfo: TStat
|
||||
if followSymlink:
|
||||
if lstat(path, rawInfo) < 0'i32:
|
||||
if stat(path, rawInfo) < 0'i32:
|
||||
raiseOSError(osLastError())
|
||||
else:
|
||||
if stat(path, rawInfo) < 0'i32:
|
||||
if lstat(path, rawInfo) < 0'i32:
|
||||
raiseOSError(osLastError())
|
||||
rawToFormalFileInfo(rawInfo, result)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user