How to sync a file on FreeBSD?

Alejandro Imass ait at p2ee.org
Fri Jul 22 11:22:21 UTC 2011


If you used fsync it should write to permanent storage immediately,
and it's no longer the OS' problem. If it's not flushing immediately,
maybe the mystery is at the filesystem level or even hardware, both of
which you didn't provide. When you say 'users' are they looking at the
file via NFS or HTTP? if the latter they could be seeing a cached copy
(proxy, browser, etc.).


On Fri, Jul 22, 2011 at 2:44 AM, Unga <unga888 at yahoo.com> wrote:
> Hi all
>
> How to sync a file on FreeBSD (esp. on 8.1) to disk?
>
> I used fsync(2), but does not immediately flush to disk.
>
> I want my writing to a file (a log file) immediately available to other users to read.
>
> Best regards
> Unga
> _______________________________________________
> freebsd-questions at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at freebsd.org"
>


More information about the freebsd-questions mailing list