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

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

2020-04-12 16:25:44 +0200, Vincent Lefevre:
> > 	  by the link, and not the link itself. If the
> > 	                                        ^^^^^^
> > 	  referenced file does not exist, the file information
> > 	  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > 	  and type shall be for the link itself.
> > 	  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> At least, that's explicit, unambiguous documentation.

Well, as seen in the varying interpretations made by the various
implementations, it is not that clear. How do you determine
whether a file exists or not? What does "exist" mean?

If ENOENT or ENOTDIR is returned upon stat(), you can tell
there's no file at that path, but it's not so clear with ELOOP,
EACCES, EOVERFLOW, ENOMEM for instance, where we can't tell for
sure the file doesn't "exist". If didn't exist for the caller at
the time in that it can't access it, but it may exist in the
"absolute" or for a caller with different credentials or in a
different namespace (could also apply for ENOENT/ENOTDIR in that

That was discussed on the austin-group mailing list not so long
ago wrt glob(3)



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