def filetype(mode):
  if stat.S_ISLNK(mode):
    return "link"
  elif stat.S_ISDIR(mode):
    return "dir"
  elif stat.S_ISREG(mode):
    return "file"
  else:
    return "unknown"
Returns "dir" or "file" according to what type path is.
dataset/ETHPy150Open cloudera/hue/apps/filebrowser/src/filebrowser/lib/rwx.py/filetype