Editing Hard Linked Files in Emacs

jbk jbk-SkCWf5sxpj0sV2N9l4h3zg at public.gmane.org
Sat Dec 27 07:50:27 EST 2008


David Kramer wrote:
> jbk wrote:
>> jbk wrote:
>>> How do you maintain the hardlink when saving with emacs? 
>>> Version control? VI won't do.
>>>
>> Well I guess you all are stumped or to busy with the new toys.
> 
> Well, I didn't get much help either, but I'm assuming it's the holidays.
> 
>> My work around is to edit the original and save as another then:
>>
>> cat <saveAs> > <originalFile>
>>
>> this works for now.
> 
> I didn't answer because I don't understand the problem.  Are you talking
> about files that are the same inodes, as created by "ln" without the the
> "-s" option?  How could emacs (or any program) possibly change the
> contents of one without changing the contents of the other, since they
> point to the same spot on the disk?
> 
> Can you explain the problem in greater detail?
> 

Yes, I want to change one to change them all.

In emacs the default is to save the original as
<original.~>. So the original remains hard linked to the
others. I've looked at all the save options in the emacs
info files and tried a number without getting a solution
that worked. There are a number of network scripts in etc
that are hard linked. I didn't realize this until I tried to
correct a problem and discovered that my edits were not
being recognized because the other remaining hard linked
files were not changed also.
In VI you can do it. My work around is sufficient for now.

Jim KR






More information about the Discuss mailing list