577
584
def get_file_size(self, file_id):
578
586
return os.path.getsize(self.id2abspath(file_id))
581
589
def get_file_sha1(self, file_id, path=None, stat_value=None):
583
592
path = self._inventory.id2path(file_id)
584
593
return self._hashcache.get_sha1(path, stat_value)
586
595
def get_file_mtime(self, file_id, path=None):
588
598
path = self._inventory.id2path(file_id)
589
599
return os.lstat(self.abspath(path)).st_mtime
591
601
if not supports_executable():
592
602
def is_executable(self, file_id, path=None):
593
604
return self._inventory[file_id].executable
595
606
def is_executable(self, file_id, path=None):
597
609
path = self._inventory.id2path(file_id)
598
610
mode = os.lstat(self.abspath(path)).st_mode
599
611
return bool(stat.S_ISREG(mode) and stat.S_IEXEC & mode)