Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I cannot do a filecopy in Delhi, getting conflicting error codes

Steve_again

Programmer
Sep 22, 2023
2
US
I am trying to use Delphi to copy a .txt file to an external usb hard drive.

Depending on how I code it, I get 2 different error codes: error 80 (Destination File is there) and Error 32 file not found.
The code is: copyfile(pchar(mysrc),pchar(mydest),b1);

I use an "if file exists(mysrc) and it shows it is there.
The error 32 tells me the copy of the file needs to be there, so it has something to overwrite.
So I renamed another file to have the same file name as the source file. It fails on an error 80, the Dest file is there.

I though that even though the source file is there, I suspected it might be related to permissions. I went into folder properties, set it the share, and gave user "Everyone full control, but it still says file not found. Which file, the is not found - source or destination?

Thanks in advance, people.
- Steve
 

Part and Inventory Search

Sponsor

Back
Top