On Mon, Jan 28, 2002 at 11:07:35AM +0000, Andrew Wilson wrote:
> Are you sure it's not symbolic links you want it to copy?  Surely when
> you make a hard link to all intents and purposes the new entry is the
> file.  How could any program tell what other hard links were made to an
> inode without examining every directory on your disc.

You seem to have inodes and dirents linked in your brain
incorrectly. Examining an inode gives you it's link-count.  Files
aren't disposed of until all their hard links are gone, so you can
also use it as a poor-mans backup system.

  rm *               # oops
  ln ../backup/* .   # phew
  
It's also why the system call is unlink and not nuke_from_orbit( "it's
the only way to be sure" );

> It would make much more sense if it saw that you were editing a symlink
> and copied the file over in that case.  Are you sure that's not the
> behaviour you're remembering but trying to get it to do it for hard
> links?

No, I know I have this behaviour for hardlinks with emacs, I was just
striving to produce a really tidy patch by using something less
full-auto.

-- 
Richard Clamp <[EMAIL PROTECTED]>

Reply via email to