>Is this a right way of defining it?
Every way is the right way as long as it compiles and does what you want. Your question can't be answered as asked.
>How do I Modify a file?
You read the file, make your changes in memory, then write the changed file back.
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Offline 11,807 posts
since Sep 2004