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 (file descriptors). Other than these, are there any performance reasons for doing so? Method (2) is used in source code file mkfs.c when we open a special device file to create a file system. Thanks for any help. -Zhihui -------------------------------------------------- Zhihui Zhang. Please visit http://www.freebsd.org -------------------------------------------------- To Unsubscribe: send mail to majord...@freebsd.org with "unsubscribe freebsd-hackers" in the body of the message