The stat module has a predicate
named S_ISDIR() that tests the
mode bits to see if they describe a directory.
# - - - P a t h I n f o . i s D i r - - -
def isDir ( self ):
"""Predicate to test whether this path is a directory.
[ if self represents a directory ->
return a true value
else ->
return a false value ]
"""
return stat.S_ISDIR ( self.mode )