emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: backup method


From: Richard Stallman
Subject: Re: backup method
Date: Thu, 27 Jan 2005 17:18:57 -0500

    The default backup method is mv and then create a new file. That's
    nice if you really want to keep the timestamp intact. But if you
    use emacs with crontab -e you remove the tmpfile and since the
    filedescriptor is still open your update to your cron is lost --
    without warning. It was pretty hard to discover why this happened.

    So I would like to suggest to  make backup by copying the default.

I won't change it in general, but we could probably arrange to use
backup by copying for *this specific case*.  Can you give a precise
recipe for distinguishing this case--a regexp for these file names,
perhaps?

    If the file is open ie another program has fopen'ed the file then
    you have an exceptional case.

    lsof and fstat ( for BSD ) can detect open file descriptors. I
    suppose emacs can do the same.

It is not the case in general that the existence of other descriptors
means it is better to backup by copying.  That's what you want in this
particular case, for crontab files.  However, in other cases where
another program is reading the old version, it should be able to
continue reading the old version, and editing the file should not
interfere with it.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]