Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [BUG] zf_ln complains about the wrong argument



On Sun, Aug 22, 2021 at 6:35 PM Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
>
> On 8/22/21, Marlon Richert <marlon.richert@xxxxxxxxx> wrote:
> > When the second argument to zf_ln is an empty string, zf_ln mistakenly
> > reports that the first argument is a non-existing file or dir:
> >
> > % zmodload zsh/files
> > % touch foo
> > % zf_ln foo ''
> > zf_ln: foo: no such file or directory
>
> As do zf_mv, gnu ln, and gnu mv.

Well, two wrongs don't make a right, don't you think? Just because Gnu
prints confusing error messages, doesn't mean Zsh can't do better.

Plus, BSD ln does manage to complain about the right file:

% ln foo ''
ln: : No such file or directory

Also, I discovered this happens, too, when trying to create a symlink
in a dir that doesn't exist:

% zf_ln foo bar/baz
zf_ln: foo: no such file or directory

BSD ln again gives a better error message (although still not 100% accurate):

% ln foo bar/baz
ln: bar/baz: No such file or directory




Messages sorted by: Reverse Date, Date, Thread, Author