
Tim Connors wrote:
On Wed, 11 Apr 2012, Trent W. Buck wrote:
Russell Coker wrote:
On Tue, 10 Apr 2012, Jason White <jason@jasonjgw.net> wrote:
It is my (perhaps faulty) understanding that most editors omit the fsync() and that the file will only be on your memory stick when you unmount it in the typical case.
open("test", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 4 write(4, "test\n\n", 6) = 6 fsync(4) = 0 stat("test", {st_mode=S_IFREG|0644, st_size=6, ...}) = 0 close(4)
I've just run strace on vim and it calls fsync.
If most editors omit the fsync() as you claim then please run strace and find us an example of one - and file a bug report while you are at it. ;)
FYI,
execve("/usr/bin/emacs", ["emacs", "-Q", "/tmp/y"], [/* 46 vars */]) = 0 [...] fsync(4) = 0
Gah! When did they fix that "bug"?
I don't know. It surprised me as well. That test was from GNU Emacs 23.3.1 (arm-unknown-linux-gnueabi) of 2011-08-15 on cushaw, modified by Debian Since emacs switched to bzr, it now takes 750MB of RAM and about three hours to clone the repo, and I don't have the resources to do that. (There is a git mirror, but ICBF fetching it just to check for you.)
Maybe I have managed to turn that mode off with one of the many possible backup behaviours of emacs. Or maybe it explains why emacs has been so slow at autosaving lately.
Dunno; note I was testing with -Q.