예제 #1
0
def stat(filepath):
  info, err = Stat(filepath)
  if err:
    raise OSError(err.Error())
  return StatResult(info)
예제 #2
0
def isdir(path):
  info, err = Stat(path)
  if info and err is None:
    return info.Mode().IsDir()
  return False
예제 #3
0
def isfile(path):
  info, err = Stat(path)
  if info and err is None:
    return info.Mode().IsRegular()
  return False
예제 #4
0
def exists(path):
  _, err = Stat(path)
  return err is None