Nathan Sims
2011-11-16 02:02:27 UTC
I have one Cocoa-based process that needs to publish a small amount of data (32 bytes) about 1/sec to n other C-based processes that are busy doing calculations. I was thinking of writing to a small file in /tmp, and then the other process could read it (if/when they choose to).
Q: Does a file opened for write-only "w" access preclude others from reading it? Will an open "r" call to a file that's being written simply hang until the writer closes it? Will a write-only open call on a file that's being read hang?
Perhaps there's a better approach to this...
Q: Does a file opened for write-only "w" access preclude others from reading it? Will an open "r" call to a file that's being written simply hang until the writer closes it? Will a write-only open call on a file that's being read hang?
Perhaps there's a better approach to this...