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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copyfile

Status
Not open for further replies.

ceodav

Programmer
Feb 21, 2003
106
IT
hi,
if i want to copy a file waht would i have to do?
i'm trying to use Copyfile insruction but it doesn't work.
i'm surprised because i thought was very simple.

i'm using:
CopyFile(zip,temp,FALSE);
where zip it's the source whereas temp is the destination, such as
zip a:\\AE.zip
temp C:\\temp\\AE.zip

any ideas?
 
The cause of CopyFile failure can be many, like read error on a:, directory c:\temp not existing, not the correct access rights, etc. If you want to know the cause, use this:

DWORD dwErc = 0;
if ( !CopyFile ( zip, temp, FALSE ))
{ dwErc = GetLastError ( );
// now dwErc contains the cause of the error
}

Marcel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top