Next / Previous / Contents / Shipman's homepage

6.6. PathInfo.isDir(): Is this a directory?

The stat module has a predicate named S_ISDIR() that tests the mode bits to see if they describe a directory.

pathinfo.py
# - - -   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 )