Duplicate a file?
-
How do you duplicate a file? Is there a windows API? Or do you just use CFile to read it in and create a new copy? Thanks for the insight.
Try CopyFile or CopyFileEx here is the description:
BOOL CopyFile( LPCTSTR lpExistingFileName, LPCTSTR lpNewFileName, BOOL bFailIfExists );
Tom Wright tawright915@yahoo.com -
How do you duplicate a file? Is there a windows API? Or do you just use CFile to read it in and create a new copy? Thanks for the insight.
In addition to what Tom said, I would also suggest looking at the MakeSureDirectoryPathExists function if you need to copy the file to a specific folder hierarchy. (This function is in the dbghelp.dll, which you'll need to distribute depending on the target OS - http://msdn.microsoft.com/library/default.asp?url=/library/en-us/debug/base/makesuredirectorypathexists.asp) Cheers, Tom Archer - Archer Consulting Group
"Eat your brussel sprouts, Junior. There are starving Chinese children American programmers that would kill for that food!" -
Try CopyFile or CopyFileEx here is the description:
BOOL CopyFile( LPCTSTR lpExistingFileName, LPCTSTR lpNewFileName, BOOL bFailIfExists );
Tom Wright tawright915@yahoo.com -
In addition to what Tom said, I would also suggest looking at the MakeSureDirectoryPathExists function if you need to copy the file to a specific folder hierarchy. (This function is in the dbghelp.dll, which you'll need to distribute depending on the target OS - http://msdn.microsoft.com/library/default.asp?url=/library/en-us/debug/base/makesuredirectorypathexists.asp) Cheers, Tom Archer - Archer Consulting Group
"Eat your brussel sprouts, Junior. There are starving Chinese children American programmers that would kill for that food!"