This was causing a bug with a makefile that expected $(wildcard */) to only return directories. Sort of explained by: http://pastie.org/9795375 Steps to reproduce: $ touch afile $ stat afile/ stat: cannot stat ‘afile/’: Not a directory $ LD_PRELOAD="libpsuedo.so" PSEUDO_PREFIX=. stat afile/ File: ‘afile/’ Size: 0 Blocks: 0 IO Block: 4096 regular empty file <etc>
Huh, that's fascinating! I was not aware of this idiom. Apparently, the stat syscall will take a literal filename of "a/" as meaning the same thing as "a", but will fail with ENOTDIR if a is not a directory. I'd never seen that before, and my initial check of the documentation doesn't actually turn it up, but it's probably possible to implement.
It seems to be explained in path_resolution(7), specifically: Trailing slashes If a pathname ends in a '/', that forces resolution of the preceding component as in Step 2: it has to exist and resolve to a directory. Oth‐ erwise, a trailing '/' is ignored. (Or, equivalently, a pathname with a trailing '/' is equivalent to the pathname obtained by appending '.' to it.)
Oh, whoops. This got fixed a while back, I never updated the bug.