On Sat, 7 Dec 2002, Yukihiro Matsumoto wrote:

M> |lstat itself seems to have strange behaviour :
M> |
M> |  /tmp > ruby -r find -e "p File.lstat('bar').directory?"
M> |  false
M> |
M> |  /tmp > ruby -r find -e "p File.lstat('bar/').directory?"
M> |  true
M> |
M> |i checked and this is the behaviour of the underlying C calls as well.  is
M> |this a linux bug, or do all lstat/stat posix calls work that way?
M>
M> "bar/" is "bar" and "", which is considered as "bar/.", so that it is
M> referring the directory itself.  I'm not sure if it's POSIX-ly defined
M> behavior.

i'm not 100% positive, but i did some searching on google and ran some tests
on our irix/sun/linux/hp-ux boxes : it seems linux is the only system
exhibiting this - which is considered a bug in fileutils.

in fact, lstat bar when bar is linked to foo should tell you that bar is also
a directory - which is does not on linux unless you lstat bar/

-a

-- 

 ====================================
 | Ara Howard
 | NOAA Forecast Systems Laboratory
 | Information and Technology Services
 | Data Systems Group
 | R/FST 325 Broadway
 | Boulder, CO 80305-3328
 | Email: ahoward / fsl.noaa.gov
 | Phone:  303-497-7238
 | Fax:    303-497-7259
 ====================================