cleaned up various modules

This commit is contained in:
Araq 2014-09-19 00:54:01 +02:00
commit d4bc11b654
12 changed files with 65 additions and 64 deletions

View file

@ -375,7 +375,7 @@ proc getFileSize*(file: string): BiggestInt =
var hFile = findFirstFileA(file, fileData)
if hFile == INVALID_HANDLE_VALUE:
raise newException(EIO, $getLastError())
raise newException(IOError, $getLastError())
return fileData.nFileSizeLow
@ -386,10 +386,10 @@ proc getDiskFreeSpaceEx*(lpDirectoryName: cstring, lpFreeBytesAvailableToCaller,
proc getPartitionInfo*(partition: string): TPartitionInfo =
## Retrieves partition info, for example ``partition`` may be ``"C:\"``
var FreeBytes, TotalBytes, TotalFreeBytes: TFiletime
var res = getDiskFreeSpaceEx(r"C:\", FreeBytes, TotalBytes,
TotalFreeBytes)
return (FreeBytes, TotalBytes)
var freeBytes, totalBytes, totalFreeBytes: TFiletime
discard getDiskFreeSpaceEx(r"C:\", freeBytes, totalBytes,
totalFreeBytes)
return (freeBytes, totalBytes)
when isMainModule:
var r = getMemoryInfo()