make tgetfileinfo work on Windows
This commit is contained in:
parent
6d645e5240
commit
a85e954b5d
1 changed files with 16 additions and 8 deletions
|
|
@ -104,23 +104,31 @@ proc testGetFileInfo =
|
||||||
|
|
||||||
createDir(dirPath)
|
createDir(dirPath)
|
||||||
writeFile(filePath, "")
|
writeFile(filePath, "")
|
||||||
createSymlink(dirPath, linkDirPath)
|
when defined(posix):
|
||||||
createSymlink(filePath, linkFilePath)
|
createSymlink(dirPath, linkDirPath)
|
||||||
|
createSymlink(filePath, linkFilePath)
|
||||||
|
|
||||||
let
|
let
|
||||||
dirInfo = getFileInfo(dirPath)
|
dirInfo = getFileInfo(dirPath)
|
||||||
fileInfo = getFileInfo(filePath)
|
fileInfo = getFileInfo(filePath)
|
||||||
linkDirInfo = getFileInfo(linkDirPath, followSymlink = false)
|
when defined(posix):
|
||||||
linkFileInfo = getFileInfo(linkFilePath, followSymlink = false)
|
let
|
||||||
|
linkDirInfo = getFileInfo(linkDirPath, followSymlink = false)
|
||||||
|
linkFileInfo = getFileInfo(linkFilePath, followSymlink = false)
|
||||||
|
|
||||||
echo dirInfo.kind
|
echo dirInfo.kind
|
||||||
echo fileInfo.kind
|
echo fileInfo.kind
|
||||||
echo linkDirInfo.kind
|
when defined(posix):
|
||||||
echo linkFileInfo.kind
|
echo linkDirInfo.kind
|
||||||
|
echo linkFileInfo.kind
|
||||||
|
else:
|
||||||
|
echo pcLinkToDir
|
||||||
|
echo pcLinkToFile
|
||||||
|
|
||||||
removeDir(dirPath)
|
removeDir(dirPath)
|
||||||
removeFile(filePath)
|
removeFile(filePath)
|
||||||
removeFile(linkDirPath)
|
when defined(posix):
|
||||||
removeFile(linkFilePath)
|
removeFile(linkDirPath)
|
||||||
|
removeFile(linkFilePath)
|
||||||
|
|
||||||
testGetFileInfo()
|
testGetFileInfo()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue