make tgetfileinfo work on Windows

This commit is contained in:
Araq 2016-10-24 20:18:49 +02:00
commit a85e954b5d

View file

@ -104,22 +104,30 @@ proc testGetFileInfo =
createDir(dirPath)
writeFile(filePath, "")
when defined(posix):
createSymlink(dirPath, linkDirPath)
createSymlink(filePath, linkFilePath)
let
dirInfo = getFileInfo(dirPath)
fileInfo = getFileInfo(filePath)
when defined(posix):
let
linkDirInfo = getFileInfo(linkDirPath, followSymlink = false)
linkFileInfo = getFileInfo(linkFilePath, followSymlink = false)
echo dirInfo.kind
echo fileInfo.kind
when defined(posix):
echo linkDirInfo.kind
echo linkFileInfo.kind
else:
echo pcLinkToDir
echo pcLinkToFile
removeDir(dirPath)
removeFile(filePath)
when defined(posix):
removeFile(linkDirPath)
removeFile(linkFilePath)