Werner LEMBERG <w...@gnu.org> writes:

> I'm shocked to read in

>   
> https://apple.stackexchange.com/questions/464706/why-do-i-get-bad-file-descriptor-when-copying-using-hardlink-flag

> that `cp -l` fails for recent macOS versions – a LilyPond user just
> confirmed that, too...

> What do you recommend to test for and/or to circumvent the issue?

I thought ln <target> <link> || ln -s <target> <link> was the standard
recipe here (in other words, fall back on symbolic links).  One has to be
very careful with how the paths are specified, though, because <target>
has a different meaning for ln -s than for ln.

(Note that even on modern systems, hard links are only reliably usable
within the same directory.  The example in the Stack Exchange question is
hard-linking to a different directory, which I would expect to fail in
lots of situations, such as on AFS file systems.)

-- 
Russ Allbery (ea...@eyrie.org)             <https://www.eyrie.org/~eagle/>

Reply via email to