From 73570cbe38e46362210ab829100f13429c90eef0 Mon Sep 17 00:00:00 2001 From: Clay Sweetser Date: Tue, 15 Apr 2014 02:28:50 -0400 Subject: Allowed getFileInfo to accept TFile objects. --- lib/pure/os.nim | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/pure/os.nim b/lib/pure/os.nim index bfc63dfc6..30a5ae949 100644 --- a/lib/pure/os.nim +++ b/lib/pure/os.nim @@ -1828,7 +1828,7 @@ template rawToFormalFileInfo(rawInfo, formalInfo): expr = if S_ISDIR(rawInfo.st_mode): formalInfo.kind = pcDir 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 ## handle. ## @@ -1849,6 +1849,9 @@ proc getFileInfo*(handle: TFileHandle, result: var FileInfo) = osError(osLastError()) rawToFormalFileInfo(rawInfo, result) +proc getFileInfo*(file: TFile): FileInfo = + result = getFileInfo(file.fileHandle()) + proc getFileInfo*(path: string, followSymlink = true): FileInfo = ## Retrieves file information for the file object pointed to by `path`. ## -- cgit 1.4.1-2-gfad0