open a file for read and write

1999-05-21 Thread Zhihui Zhang
If I want to read and write a file, I can do it in two ways: (1) Open the file as read and write, using one file descriptor. (2) Open the file as read only and open it again as write only, using a total of two file descriptors. Method (2) is more clear in logic and uses a little more resource

Re: open a file for read and write

1999-05-21 Thread Ronald G. Minnich
On Fri, 21 May 1999, Zhihui Zhang wrote: (1) Open the file as read and write, using one file descriptor. (2) Open the file as read only and open it again as write only, using a total of two file descriptors. Method (2) is more clear in logic and uses a little more resource (file you're