momsoft2
asked on
Why does CopyFile never fail?
I am using CopyFile to make a backup of an important file. It seems that CopyFile always returns true, even if the path is not accessible, or the disk or file are read-only. What system do you recommend to make sure that the file has been copied successfully?
ERROR := Not CopyFile(PChar(ConfigFilename),PChar(ConfigBackup),False);
ASKER
Thank you very much. This is definitely a step in the right direction.
Your function does indeed fail if the destination is invalid, but then, the original file stays locked and I get errors if I try to access it again.
Your function does indeed fail if the destination is invalid, but then, the original file stays locked and I get errors if I try to access it again.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you very much for your help!
Open in new window