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

Re: glob qualifier '-' doesn't work correctly on dangling symlinks



On Sun, 2020-04-12 at 16:31 +0200, Vincent Lefevre wrote:
> On 2020-04-12 13:48:43 +0100, Peter Stephenson wrote:
> > For convenience, the proposed wording in the attached is
> > 
> > item(tt(-))(
> > toggles between making the qualifiers work on symbolic links (the
> > default) and the files they point to, if any; a broken symbolic link
> > is treated as a file in its own right
> > )
> 
> The term "broken symbolic link" should properly be defined.
> It seems that the zsh code ignores all stat() errors, so that
> this may be very surprising, if not dangerous. Imagine a script
> whose goal is to remove all dangling symlinks, but could remove
> valid ones due to undetected errors as not reported by zsh...

Right, you're saying we don't know the reason it failed without looking
explicitly at the error, and should be clear about that... how about...

item(tt(-))(
toggles between making the qualifiers work on symbolic links (the
default) and the files they point to, if any; any symbolic link for
whose target the `tt(stat)' system call fails (whatever the cause of the
failure) is treated as a file in its own right
)

I don't think we necessarily tell the reason (as opposed to the error code)
can we?  EPERM might refer to a surrounding directory?

pws



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