Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: misc glob fixes
- X-seq: zsh-workers 3965
- From: Zoltan Hidvegi <hzoli@xxxxxxxxxxxxxxx>
- To: zefram@xxxxxxxxx (Andrew Main)
- Subject: Re: PATCH: misc glob fixes
- Date: Mon, 11 May 1998 10:49:06 -0500 (CDT)
- Cc: zsh-workers@xxxxxxxxxxxxxxx
- In-reply-to: <199805110936.KAA22602@xxxxxxxxxxxxxxxx> from Andrew Main at "May 11, 98 10:36:47 am"
Zefram wrote:
> Zoltan Hidvegi wrote:
> >First, many systems ignore trailing slashes on filenames. As a result */
> >will match all files instead of just directories as required by common
> >sense and the POSIX standard. The solution is to stat/lstat/access
> >`filename/.' instead of `filename/'.
>
> But "filename/." can't be statted if the directory is not searchable
> by the zsh process, whereas POSIX would require the glob to succeed.
> It would be better to stat "filename/" and test that the result has
> type directory.
Actually I'm not sure about that. POSIX requites that pathname
components other than the last component should be searchable. You
can think filename/ as two components, the second component is empty.
I tested many shells (various old Korn and Bourne shells) and none of
them matches unsearchable directories with */
Also note that on Linux you need search permission on filename in
order to stat filename/, so on Linux sometimes you are not allowed to
stat filename/ while you are allowed to stat filename. The same is
true for the good old Ultrix 4.2, and perhaps other systems. On these
systems the patch has no effect on the shell behavior. I think the
shell should behave the same way on all systems, and it should behave
like sh and ksh, so I think that the patch implements the correct
behavior.
Zoli
Messages sorted by:
Reverse Date,
Date,
Thread,
Author