code: def listdir(self, pattern=None):
          
          names = os.listdir(self)
          if pattern is not None:
              names = fnmatch.filter(names, pattern)
          return [self / child for child in names]
docs: D.listdir() -> List of items in this directory.
  
          Use D.files() or D.dirs() instead if you want a listing
          of just files or just subdirectories.
  
          The elements of the list are path objects.
  
          With the optional 'pattern' argument, this only lists
          items whose names match the given pattern.