Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!news.swapon.de!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Martin Gregorie Newsgroups: comp.lang.java.programmer Subject: Re: compile directly into a .zip/.jar file? Date: Thu, 17 Apr 2014 12:58:00 +0000 (UTC) Organization: A noiseless patient Spider Lines: 40 Message-ID: References: <1l96oa6aew63h$.1wt64t9w3vv91.dlg@40tude.net> <534ad197$0$301$14726298@news.sunsite.dk> <534c8e5e$0$297$14726298@news.sunsite.dk> <534dc817$0$300$14726298@news.sunsite.dk> <534f0526$0$301$14726298@news.sunsite.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Thu, 17 Apr 2014 12:58:00 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="e5160e2be48f1ea550cf61512446f525"; logging-data="24660"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+2CgqFZeNFTZ/BixwIL+kTeiDeO4jnxH4=" User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508 git://git.gnome.org/pan2) Cancel-Lock: sha1:dUsD5DPAmcXhbBhvuCrIZSkmHXw= Xref: csiph.com comp.lang.java.programmer:28118 On Wed, 16 Apr 2014 18:33:10 -0400, Arne Vajhøj wrote: > On 4/16/2014 8:29 AM, Martin Gregorie wrote: >> On Tue, 15 Apr 2014 20:00:22 -0400, Arne Vajhøj wrote: >> >>> AFAIK then fflush only move data from user space to system space. >>> >>> To get data on the plates you need fsync. >>> >> The manpages for fflush()m and fsync() could be a little clearer, but I >> read them as saying that both functions force a write to disk. The only >> difference is the type of file reference argument they take: fflush() >> takes a FILE* stream reference while fsync() takes an int file >> description. > > Linux man pages are rather clear: > > > Notes Note that fflush() only flushes the user-space buffers provided by > the C library. To ensure that the data is physically stored on disk the > kernel buffers must be flushed too, for example, with sync(2) or > fsync(2). > Don't think so: fsync() flushes a single file all the way to disk according to its manpage, which says that it makes the file safe against crashes and reboots. So does fflush(), because it, also according to its manpage, by calling fsync() on the filedesc underlying the FILE* passed to fflush(). There's an extension: fflush(NULL) flushes all streams opened by the process. sync() is rather different. It flushes all buffetrs belonging to all open files regardless of which process is using them. -- martin@ | Martin Gregorie gregorie. | Essex, UK org |