AFAIK each process will maintain separate file table (correct me if my understanding is wrong). So for example same file is opened in APPEND mode by multiple processes at time and each process is writing some data to the file. It gets appended at end of file correctly. So can anyone explain me how file table in all the processes gets updated at a time? Thanks in advance
AFAIK each process will maintain separate file table (correct me if my understanding is
Share
I don’t think the file tables are updated. It’s simply that the filesystem “seeks” to the end of the file before writing.
Since unrelated processes are allowed to write to the end of file at the same time, I believe some sort of locking must be involved, the seek and the actual write must not be interrupted.
This append mode is very much a feature of a particular filesystem, not a feature of an operating system. I remember clearly that on Linux,
O_APPENDdoesn’t do the right thing if the file resides in NFS.