coreutils
[Top][All Lists]
Advanced

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

Re: ln -s A B fails if symlink B exists and its value is too long


From: Jim Meyering
Subject: Re: ln -s A B fails if symlink B exists and its value is too long
Date: Fri, 27 Dec 2013 10:03:19 -0800

On Thu, Dec 26, 2013 at 7:47 PM, Ken Irving <address@hidden> wrote:
> I happened to run into a case were ln -s exited with a confusing message,
> and reduced it to the following:
>
>     ln -s $(printf '%0.sx' {1..256}) len256
>     ln -s x len256
>
> (where the printf is there just to create a value 256 bytes long).
> The second command exits with value 1 and emits this message:

Thanks for the report.  I see that Pádraig is already on it (thanks!).

Just a note that your printf expression produces a result much longer
than 256 bytes.
You can use this to see the 255->256 transition:

    $ rm -f x; env ln -s $(printf '%0*d' 255 0) x; env ln -s a x
    ln: failed to create symbolic link ‘x’: File exists
    [Exit 1]
    $ rm -f x; env ln -s $(printf '%0*d' 256 0) x; env ln -s a x
    ln: failed to access ‘x’: File name too long
    [Exit 1]



reply via email to

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