View Single Post
Old Sep 20th, 2007, 10:36 PM   #3
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
For each file:

Open a temp file. Write the code to be added to the temp file. Open the old file. Read that and write the contents to the temp file. Close both files. Rename the temp file to the name of the old file.

If you have failed to properly describe what you need, then toss out this answer, along with your description.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote