• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

move file A to file B

 
Ronnie Phelps
Ranch Hand
Posts: 329
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does anyone have any suggestions on the bestway of replacing the contents of one file with the contents of another...given that both files exist.
 
Ryan Langley
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
The default behavior of the File IO streams is to overwrite what was already in the file. IF you want to append, you have to specifically flag it in the constructor to do so. If the data is important to keep around, or is needed for auditing or something, then I would make a back-up copy of the file before you overwrite it. You can use whatever schema you want for that, and it depends on how long you want to keep back-up copy's around. Here is a basic app that I wrote up real quick to show some of the ways you can use File IO. Hope this helps in answering your question!


------------------
Cheers,
RL
 
Ronnie Phelps
Ranch Hand
Posts: 329
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ryan..that was really helpful!! I need to brush up on my I/O knowledge. :-)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic