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... Directory?

Status
Not open for further replies.

ronnyjljr

IS-IT--Management
Nov 23, 2003
249
US
Maybe I am approaching this wrong, we'll see.

I am trying to duplicate a directory, of course I have renamed the new directory. Now, I tried using the CopyFile method and it fails everytime, so I decided to loop through the directorycontents. The CopyFile again, fails everytime.

What gives?

Basically just doing CopyFile(Original,Duplicate,False);
Where Original and Duplicate are different names.

-Thanks,
Ron

/**************
Me: When will the project be finished?
Them: What project?
Me: The one you have been working on for the last 3 years!
Them: Ohh, we can't finish it?
Me: Why?
Them: We don't know how to program...
 
Is your Original and duplicate the full path names?

Check by stepping through to the Copy statement and check the file names??

I use
Code:
CopyFile ( (LPCTSTR) file2Copy, (LPCTSTR) newLocation, false )

and it works fine for me??? So need more info before I can help any?? i.e. does it simply not copy the file. Have you tried using GetLastError()???
 
Thanks Shetland!

It turns out it did need the full path names.
I thought I had them in but apparently not.

-Ron

cout << "If you don't know where you want to go, we'll make sure you get taken";
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top