예제 #1
0
  def __init__(self, file_status, parent_path):
    self.path = Hdfs.join(parent_path, decode_fs_path(file_status['pathSuffix']))
    self.isDir = file_status['type'] == 'DIRECTORY'
    self.atime = file_status['accessTime'] / 1000
    self.mtime = file_status['modificationTime'] / 1000
    self.user = file_status['owner']
    self.group = file_status['group']
    self.size = file_status['length']
    self.blockSize = file_status['blockSize']
    self.replication = file_status['replication']

    self.mode = int(file_status['permission'], 8)
    if self.isDir:
      self.mode |= stat.S_IFDIR
    else:
      self.mode |= stat.S_IFREG
예제 #2
0
    def __init__(self, file_status, parent_path):
        self.name = decode_fs_path(file_status['pathSuffix'])
        self.path = Hdfs.join(parent_path, self.name)
        self.isDir = file_status['type'] == 'DIRECTORY'
        self.type = file_status['type']
        self.atime = file_status['accessTime'] / 1000
        self.mtime = file_status['modificationTime'] / 1000
        self.user = file_status['owner']
        self.group = file_status['group']
        self.size = file_status['length']
        self.blockSize = file_status['blockSize']
        self.replication = file_status['replication']

        self.mode = int(file_status['permission'], 8)
        if self.isDir:
            self.mode |= stat.S_IFDIR
        else:
            self.mode |= stat.S_IFREG