Help with copy????

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Oct 2008
Posts: 3
Reputation: Gary_nel is an unknown quantity at this point 
Solved Threads: 0
Gary_nel Gary_nel is offline Offline
Newbie Poster

Help with copy????

 
0
  #1
Oct 4th, 2008
Hi Im new to the whole thing of programming and would like to write a C++ program to copy files from one drive to another, any help and suggestions on where to start?

Any help with source code or pointers will be greatly appreciated. The OS the program is for is WINCE 4.2 .net embedded.

Thanks in advance
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 1,868
Reputation: twomers has a spectacular aura about twomers has a spectacular aura about twomers has a spectacular aura about 
Solved Threads: 56
twomers's Avatar
twomers twomers is offline Offline
Posting Virtuoso

Re: Help with copy????

 
0
  #2
Oct 4th, 2008
To copy a file you basically need to first read that file. To do this read about opening ifstreams as binary files ( http://www.cplusplus.com/reference/i...ream/read.html ), might want to edit that code a bit. Then you'll want to save the contents of what you read to an output file, ofstream is your weapon of choice here ( http://www.cplusplus.com/reference/i...eam/write.html )... In fact the latter link has basically your program... Write some user-input/command line parameter processing around it to allow a user to select the input and output files and hey presto done.
I blag!?
"Mr Kitty, you have to live in the attic now. Here, write a diary."
I am the Walrus!
Reply With Quote Quick reply to this message  
Join Date: Jun 2007
Posts: 275
Reputation: dougy83 is on a distinguished road 
Solved Threads: 45
dougy83 dougy83 is offline Offline
Posting Whiz in Training

Re: Help with copy????

 
1
  #3
Oct 5th, 2008
Windows CE has APIs for this kind of thing. The prototype for the function is
  1. BOOL CopyFile(LPCTSTR lpExistingFileName, LPCTSTR lpNewFileName, BOOL bFailIfExists);
.

Go to MSDN if you need info on return values, etc. try http://msdn.microsoft.com/en-us/library/ms959899.aspx
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C++ Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC