GEdit - undesirable behavior

Ken Moffat ken at kenmoffat.uklinux.net
Wed Oct 6 13:55:56 PDT 2004


On Wed, 6 Oct 2004, Dominic L Hilsbos wrote:

> It would seem that when GEdit is set to create a backup copy of a file
> it actually writes out the edited text to a new file with the same
> filename, and adds a ~ to the end of the filename of the directory entry
> for the old file.  This sounds good, except for one thing, it
> consistantly breaks hard links.  Could someone verify this behavior?  If
> it can be identified as being distinct to my distro (MDK 9.0) then I'll
> recompile gedit, and ifx it.  If not could someone work with me to find
> and correct the offending code?  I believe the behavior should be: copy
> original file, to new file, output edited text to old file, thus
> preserving hard links.
>
>

 Sounds like the correct behaviour to me.  But hardlinking text files
isn't especially common (yes, I know some man pages get hardlinked).
If you want all names for a text file to always have the same contents,
and you are going to edit the text, try using symlinks.

 Compare executable text - foo and bar are names for a script which does
slightly different things depending on what it is called.  Now rewrite
bar as a new script using completely different code which does exactly
one thing (the 'bar' functionality).  You wouldn't want foo to execute
the _new_ bar, would you ?

Ken
-- 
 das eine Mal als Tragödie, das andere Mal als Farce




More information about the lfs-chat mailing list