Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Jan 2003 11:11:35 -0800 (PST)
From:      Matthew Dillon <dillon@apollo.backplane.com>
To:        David Schultz <dschultz@uclink.Berkeley.EDU>
Cc:        Jan Srzednicki <winfried@student.agh.edu.pl>, current@FreeBSD.ORG
Subject:   Re: background fsck did not create lost+found
Message-ID:  <200301201911.h0KJBZ4g065531@apollo.backplane.com>
References:  <Pine.GSO.4.44.0301201630350.22474-100000@student.uci.agh.edu.pl> <20030120183442.GA2778@HAL9000.homeunix.com>

next in thread | previous in thread | raw e-mail | index | archive | help
:However, when you are saving a new version of an important file,
:you need to be careful that the new version (and its directory
:entry) hits the disk before the old one goes away.  I know that vi
:saves files in a safe way, whereas ee and emacs do not.  (Emacs
:introduces only a small race, though.)  Also, mv will DTRT only if
:the source and destination files live on the same filesystem.
:

    I think you have that reversed.  vi just overwrites the destination
    file (O_CREAT|O_TRUNC, try ktrace'ing a vi session and you will see). 
    I believe emacs defaults to a mode where it creates a new file and 
    renames it over the original. 

    This means that there is a period of time where a crash may result in
    the loss of the file if the vi session cannot be recovered (with vi -r)
    after the fact.

					-Matt
					Matthew Dillon 
					<dillon@backplane.com>

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200301201911.h0KJBZ4g065531>