Allowed getFileInfo to accept TFile objects.
This commit is contained in:
parent
79f0c66b4d
commit
73570cbe38
1 changed files with 4 additions and 1 deletions
|
|
@ -1828,7 +1828,7 @@ template rawToFormalFileInfo(rawInfo, formalInfo): expr =
|
||||||
if S_ISDIR(rawInfo.st_mode): formalInfo.kind = pcDir
|
if S_ISDIR(rawInfo.st_mode): formalInfo.kind = pcDir
|
||||||
if S_ISLNK(rawInfo.st_mode): formalInfo.kind.inc()
|
if S_ISLNK(rawInfo.st_mode): formalInfo.kind.inc()
|
||||||
|
|
||||||
proc getFileInfo*(handle: TFileHandle, result: var FileInfo) =
|
proc getFileInfo*(handle: TFileHandle): FileInfo =
|
||||||
## Retrieves file information for the file object represented by the given
|
## Retrieves file information for the file object represented by the given
|
||||||
## handle.
|
## handle.
|
||||||
##
|
##
|
||||||
|
|
@ -1849,6 +1849,9 @@ proc getFileInfo*(handle: TFileHandle, result: var FileInfo) =
|
||||||
osError(osLastError())
|
osError(osLastError())
|
||||||
rawToFormalFileInfo(rawInfo, result)
|
rawToFormalFileInfo(rawInfo, result)
|
||||||
|
|
||||||
|
proc getFileInfo*(file: TFile): FileInfo =
|
||||||
|
result = getFileInfo(file.fileHandle())
|
||||||
|
|
||||||
proc getFileInfo*(path: string, followSymlink = true): FileInfo =
|
proc getFileInfo*(path: string, followSymlink = true): FileInfo =
|
||||||
## Retrieves file information for the file object pointed to by `path`.
|
## Retrieves file information for the file object pointed to by `path`.
|
||||||
##
|
##
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue