help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: emacs changed file's own user and file permission


From: Xah Lee
Subject: Re: emacs changed file's own user and file permission
Date: Mon, 10 Dec 2007 10:42:35 -0800 (PST)
User-agent: G2/1.0

How to stop emacs's backup changing the file's creation date of the
original file?

Put this code in your emacs init file: "(setq backup-by-copying t)"

Explanation: when emacs does a backup, by default it renames the
original file into the backup file name, then create a new file as the
original file. So that, the original file effectively have its
creation date and other meta data completly changed.

Unix-like systems (unixes and linuxes) file systems do not record file
creation date. (this is one of the major fuckup in unixes, and is a
fact few unix people knew, even senior unix sys admins. (I'm not sure
what file system linuxes uses now, but is so up to 2004))

The emacs's default behavior is especially bad for Macs, because once
you edited some file, its file creation timestamp info is effectively
destroyed (and become the time you saved it) This is devastating for
those uninitiated. e.g. you started to use emacs, then after a month
or so, when you one day wanted to know when was a particular file
created, you realized that it's all gone.

(this is one of the major damage unixes has done to the computing
industry)

The reason emacs by default chooses to "rename/mv" instead of the much
sensible copying to create the backup, has 2 major reasons:

(1) Emacs predominantly lives in the unix universe, even though GNU is
anti-unix in principle.

(2) Richard Stallman has a "sharing" mentality. According to the emacs
manual on the backup section, the reason given for default renaming
behavior is because that way people can know who edited the file last.
(i.e. the edited file's owener meta data is the person who last edited
it. It presumes that people work in a shared-code environment)

By far, (1) is the major cause. For (2), we could consider it as a bad
decision (and thus damage to the computing industry) that is
influenced by Richard Stallman's collectivism idealogy.

The issue of (2) is debatable or might even be reasonable given the
time frame emacs is active and influential (roughly 1980s to early
1990s). Because during that time, much computing happens in unixes,
which is a shared system. However, in the current decade, some 99% of
computing machines are used by single-user (i.e. PCs), thus the reason
given in emacs doc for emacs backup's default renaming behavior is
without much pertinence today.

--------
Extra note:

for consideration of modernization of emacs, emacs should have backup
off by default. This is because, when emacs was active and
influencial, the emacs backup is a major convenience. But in the
current decade, there's dizzing array and method of transparent and
automatic backup utilities and or revision control systems. The
emacs's auto-backup (by littering a bunch of ~ files everywhere) is
quaint, and has not been adopted by Windows or Mac (which accounts for
> 99% of computing machines used by people). Litter ~ files today is
more of a distraction than help for vast majority of people today.
-----------

In summary, i hope emacs developers will consider, in order of
importance:

* turn emacs backup off by default.
* set backup-by-copying to non-nil by default.
* Create options so that emacs backup will be all directed into a user
specified directory.

(see http://groups.google.com/group/comp.emacs/msg/4611a42bb3d767b5?dmode=source
for the last item)

  Xah
  xah@xahlee.org
\xAD\xF4 http://xahlee.org/

On Dec 9, 6:11 pm, cire <cpp...@gmail.com> wrote:
> I am using emacs on windows, have a drive T: mounting a remote host.
> while i have edited files, the file permission and owner will be
> change, that make the file don't allow user to use. How to fix that
> problem? thanks



reply via email to

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