595
588
def get_file_size(self, file_id):
597
589
return os.path.getsize(self.id2abspath(file_id))
600
592
def get_file_sha1(self, file_id, path=None, stat_value=None):
603
594
path = self._inventory.id2path(file_id)
604
595
return self._hashcache.get_sha1(path, stat_value)
606
597
def get_file_mtime(self, file_id, path=None):
609
599
path = self.inventory.id2path(file_id)
610
600
return os.lstat(self.abspath(path)).st_mtime
612
602
if not supports_executable():
613
603
def is_executable(self, file_id, path=None):
615
604
return self._inventory[file_id].executable
617
606
def is_executable(self, file_id, path=None):
620
608
path = self.id2path(file_id)
621
609
mode = os.lstat(self.abspath(path)).st_mode
622
610
return bool(stat.S_ISREG(mode) and stat.S_IEXEC & mode)