help-make
[Top][All Lists]
Advanced

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

Re: how to make symbolic links?


From: Paul Smith
Subject: Re: how to make symbolic links?
Date: Fri, 09 Sep 2011 00:10:55 -0400

On Thu, 2011-09-08 at 19:30 -0400, Mike Shal wrote:
> On Thu, Sep 8, 2011 at 8:09 AM, Paul Smith <address@hidden> wrote:
> > One last thing: it is NOT necessary that the target of a symlink exist!
> > Just because you can create the link without error doesn't meant that
> > the link can be resolved.  In fact a number of programs use this feature
> > to good advantage, since creating a symlink is an atomic operation on
> > the filesystem, for creating lock files, etc. where the target of the
> > symlink is not a file at all, but rather some useful information related
> > to the lock (etc.)  If the information you want to keep is small this is
> > MUCH more efficient than open/write/close for a real file: it's one
> > (atomic) system call.
> 
> Can you point to a specific program that uses symlinks in this way? I
> never thought of using it like that - it sounds pretty inventive so
> I'd like to see it in action :)

The most common one is probably GNU Emacs.  When you start to edit a
file, it creates a symlink like this so that if you come along with
another instance of Emacs and start to edit that same file before the
first instance has saved, Emacs knows that some other instance is
already editing it.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.mad-scientist.net
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist




reply via email to

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