[erlang-questions] file:sync problems on Mac OS X

Caspar Florian Ebeling florian.ebeling@REDACTED
Thu Aug 7 15:58:17 CEST 2008


there are problems with the kernel function file:sync/1 on the Mac. It actually
does not really syncs out to the disk, because the call does not make guarantees
on the Mac.

There is a patch mail form Jan Lehnhardt on the patch list, which also
references the
relevant Mac man pages:


Technically, this is not a bug though, because the file:sync/1
documentation says
explicitly, that this call might not have any effects on some systems.

The experience from the CouchDB people suggests, though, that the functionality
is quite essential when you use any disk persistence you care about,
like in databases.
The fsync(2) man page from OS X mentions this use case explicitly.

What is the take of the OTP team on this? Is there a chance that this
will be changed
or that this patch from the above mail gets incorporated? Can this be
filed as a bug
even though currently implemented behaviour is not conflivting with

I had the problem in a rather simple test case, so this is not
something that theoretically
happens in an esoteric edge case, but quite a real problem, it seams.

I'm also a member of the MacPorts project, and there we have a local
patch applied
to change this, but it would be good to solve this at the right place.
(I'm not the erlang
maintainer over there, but I currently use it a lot.)


Florian Ebeling

More information about the erlang-questions mailing list