Re: File access questions

Kyle Sluder <[email protected]> Wed, 16 Nov 2011 10:49:42 -0800
Newsgroups gmane.comp.macosx.devel
Message-ID <CANEs-czh6e_puGK3EvHEz7u+Bp6XomBN8gABYWsytAHP-VZL0g@mail.gmail.com>
On Wed, Nov 16, 2011 at 9:36 AM, Nathan Sims
<[email protected]> wrote:
> The integrity of the data being written/read (from one update to the next)
> isn't critical (representing very small changes in temperature), so flock()
> looks like it should be sufficient if all processes cooperate.

In that case, why use a file at all? It sounds like you've got one
daemon that reports the temperature and N clients on the same machine
that poll for the temperature. Would another IPC mechanism be more
appropriate, like perhaps a Unix domain socket?

--Kyle Sluder