Hello I am using the CopyFile function in Delphi 5. But the file is not getting copied to destination. I am not able to see error also. What is the best way to know why CopyFile is failing?
if CopyFile(source, dest, false) then
ShowMessage('Success')
else
ShowMessage('Error');
I am getting displayed error always. 🙁
If the function fails you can get extended error information, calling the
GetLastErrormethod or use the RaiseLastOSError method.Check this sample