def rwxtype(mode):
 if stat.S_ISLNK(mode):
  return 'l'
 elif stat.S_ISDIR(mode):
  return 'd'
 elif stat.S_ISREG(mode):
  return '-'
 else:
  return '?'

def rwxtype ( mode ) : if stat . S_ISLNK ( mode ) : return 'l' elif stat . S_ISDIR ( mode ) : return 'd' elif stat . S_ISREG ( mode ) : return '-' else : return '?'
returns l/d/-/? for use in "rwx" style strings .