ln -f

Alan P. Barrett barrett at undeed.UUCP
Wed Jul 25 21:20:57 AEST 1990


In article <3732 at auspex.auspex.com>, guy at auspex.auspex.com (Guy Harris)
writes about 'ln -f file1 file2':

> the answer is "you can get that behavior without adding a flag to 'ln'
> - either remove the target first using a command that doesn't barf if
> it's not there, or check if it's there first and remove it if it is."

But that doesn't give the same result.  If you remove file2 first, then
there is a brief window between the 'rm' and the 'ln' during which no
file named file2 exists.  If you use a version of 'ln' that clobbers
file2 and replaces it with a link to file1 in an atomic operation, there
is no such window.  The difference might be important in some
applications.

--apb
Alan Barrett, Dept. of Electronic Eng., Univ. of Natal, Durban, South Africa
Internet: Barrett.UNDEE at f4.n494.z5.fidonet.org      UniNet-ZA: Barrett at UNDEE
Real Soon Now: Barrett at EE.UND.AC.ZA    PSI-Mail: PSI%(6550)13601353::BARRETT



More information about the Comp.unix.wizards mailing list