[S] worked on nim. added changes to NIM docs.
This commit is contained in:
12
elinethingz/utils/checkfile.nim
Normal file
12
elinethingz/utils/checkfile.nim
Normal file
@@ -0,0 +1,12 @@
|
||||
import winim/lean
|
||||
|
||||
proc fileExists(filename: cstring): bool =
|
||||
result = GetFileAttributesA(filename) != INVALID_FILE_ATTRIBUTES
|
||||
|
||||
const
|
||||
filename = "C:\\path\\to\\your\\file.txt" # double-\ because it's an escape character.
|
||||
if fileExists(filename):
|
||||
echo "File exists."
|
||||
else:
|
||||
echo "File does not exist."
|
||||
|
||||
Reference in New Issue
Block a user