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