Andi Kleen wrote:
> > cp -al kernel kernel-branch
> > chattr -R +i kernel
> >
> > Proceed to edit files in `kernel-branch'-- safely knowing that nothing
> > you do there will alter the files in `kernel'. (Otherwise commands like
> > `prog > file' and some editors will change the hard-linked files).
>
> Attributes are per inode, not per link.
As they should be.
The point is editing operations have these basic behaviours for "save":
(1) Simply overwrite the file. This breaks `cp -al'.
(2) Copy the original file to make a backup, then write the new
file over the old one. Also breaks `cp -al'. This is
useful on occasion -- such as when you're editing scripts
that have multiple names.
(3) Rename or delete the original file, then create and write a new
one. This works nicely with `cp -al'.
> Also you could always archive the same mit chmod u-w
I don't like that because it significantly changes the original tree.
IMMUTABLE OTOH is invisible to most tools. But it's a fair point.
> (editors usually do > not force writing unless specifically asked --
> and the evil editors that do not would soon learn how to remove
> immutable..)
We can only hope they don't start doing that :-) It would be much nicer
if they remain ignorant of IMMUTABLE, but switch to strategy (3) for
saving when strategy (2) fails.
-- Jamie
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/
This archive was generated by hypermail 2b29 : Mon Jun 26 2000 - 21:00:05 EST