From owner-freebsd-questions@FreeBSD.ORG Fri Jul 22 11:22:21 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD510106566B for ; Fri, 22 Jul 2011 11:22:21 +0000 (UTC) (envelope-from aimass@yabarana.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id 927328FC08 for ; Fri, 22 Jul 2011 11:22:21 +0000 (UTC) Received: by iyb11 with SMTP id 11so2538910iyb.13 for ; Fri, 22 Jul 2011 04:22:20 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.180.155 with SMTP id bu27mr1275056ibb.162.1311333740773; Fri, 22 Jul 2011 04:22:20 -0700 (PDT) Sender: aimass@yabarana.com Received: by 10.231.17.195 with HTTP; Fri, 22 Jul 2011 04:22:20 -0700 (PDT) In-Reply-To: <1311317040.38368.YahooMailClassic@web160115.mail.bf1.yahoo.com> References: <1311317040.38368.YahooMailClassic@web160115.mail.bf1.yahoo.com> Date: Fri, 22 Jul 2011 07:22:20 -0400 X-Google-Sender-Auth: OU5xjmH4hqWfzv0Lnxg6Dl4tIuI Message-ID: From: Alejandro Imass To: Unga Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-questions@freebsd.org Subject: Re: How to sync a file on FreeBSD? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jul 2011 11:22:21 -0000 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 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@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" >