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

lstat(2) upon e and + globbing qualifiers



Hiya.

Adding a "e" or "+" qualifier to a globbing pattern seems to
cause zsh to call an unnecessary lstat(2) for each file. No big
deal, just potential performance improvement here.

There's a side effect though when you have read but not search
permission on a directory:

$ strace -fe lstat zsh -c 'echo 2/*'
2/bar 2/foo
$ strace -fe lstat zsh -c 'echo 2/*(e::)'
lstat("2/foo", 0x7fff95492110)          = -1 EACCES (Permission denied)
lstat("2/bar", 0x7fff95492110)          = -1 EACCES (Permission denied)
zsh:1: no matches found: 2/*(e::)

(reproduced with 5.0 on debian)

-- 
Stephane



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