GNU bug report logs - #32127
ln: add option to fall-back to softlink if hardlink fails

Previous Next

Package: coreutils;

Reported by: L A Walsh <coreutils <at> tlinx.org>

Date: Wed, 11 Jul 2018 19:30:02 UTC

Severity: wishlist

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: L A Walsh <coreutils <at> tlinx.org>
To: bug-coreutils <at> gnu.org
Subject: RFE -- in the way "cp -rl"  -- enable 'ln' to do likewise?
Date: Wed, 11 Jul 2018 12:29:04 -0700
If one does a 'cp -rl' -- one gets a coyp of the tree...sorta,
with file hardlinked, and with directories getting their own set
of inodes because:
can't be hardlinked -- so no hardlinking (even if worked, wouldn't make
a separate copy) &&
can't have softlinked dirs, as to softlink something, you need something
to softlink things *to*.  If dirs were softlinked, again, the files
inside would be referenced by the same name-entry in the same real 
directory.

Instead it tries to do a useful think in creating a separate tree with
a fresh set of name entries that point to the same inode-data.

In the same way, I'm often wanting to work on some set of source
files from a different starting location in the source tree.

Like I'll want an "RCS" dir to point to 1 RCS tree -- so I try to use
ln <existing RCSdir> <new RCS loc>.  ln, of course seems to think I
want the impossible -- and says you can't have hard-linked directories.

Instead, just as cp-rl only hard links files while creating new dirs
for directories in the other tree, instead of treating dirs+files the
same, and giving an error message that wouldn't be helpful.


I was wondering if ln dir1 target/ could differentiate and "do what
I meant", and create a softlink rather than giving an error and
requiring me to re enter the command with -l.

I wouldn't be against the idea of it saying that it created a softlink,
but the point it to favor it doing something useful rather than issuing an
error that isn't.

Would that be possible? 
Thanks,  Linda





This bug report was last modified 6 years and 230 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.