Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [BUG] zf_ln complains about the wrong argument
- X-seq: zsh-workers 49296
- From: Marlon Richert <marlon.richert@xxxxxxxxx>
- To: Mikael Magnusson <mikachu@xxxxxxxxx>
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: [BUG] zf_ln complains about the wrong argument
- Date: Sun, 22 Aug 2021 22:27:42 +0300
- Archived-at: <https://zsh.org/workers/49296>
- In-reply-to: <CAHYJk3Ts=+iLAH+OmPWeng4gNj9kZEjvvR2QqP5MnzrUwSP1sw@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <CAHLkEDtzSMGfxudX9Lfr+dh5i94y-mX5omdEC28Fi+xxE72DkQ@mail.gmail.com> <CAHYJk3Ts=+iLAH+OmPWeng4gNj9kZEjvvR2QqP5MnzrUwSP1sw@mail.gmail.com>
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