ChrisMorton75
16th March 2007 17:59 UTC
IfFileExists
I have a test for a file, and I get "true" when the file does not exist:
ClearErrors
; first check to see if file exists and skip if it doesn't
IfFileExists "c:\test.txt" Here NoFile
Here:
!ifdef DEBUG
!echo "File Exists"
!endif
,.
. code here
.and a jump
.
NoFile:
!ifdef DEBUG
!echo "File does not exist"
!endif
I always get the message "File Exists"
Red Wine
16th March 2007 18:10 UTC
IfFileExists is a runtime instruction, what exactly you're trying to achieve?
dienjd
16th March 2007 18:13 UTC
!echo is a build-time instruction. You don't want that in this case since IfFileExists is a run-time check. Change your !echo to MessageBox or DetailPrint, which are run-time instructions.
ChrisMorton75
16th March 2007 19:30 UTC
Thank you for the help. I was trying to find out at runtime if a file existed or not. Your help is appreciated.