586
593
def get_file_size(self, file_id):
587
595
return os.path.getsize(self.id2abspath(file_id))
590
598
def get_file_sha1(self, file_id, path=None, stat_value=None):
592
601
path = self._inventory.id2path(file_id)
593
602
return self._hashcache.get_sha1(path, stat_value)
595
604
def get_file_mtime(self, file_id, path=None):
597
607
path = self._inventory.id2path(file_id)
598
608
return os.lstat(self.abspath(path)).st_mtime
600
610
if not supports_executable():
601
611
def is_executable(self, file_id, path=None):
602
613
return self._inventory[file_id].executable
604
615
def is_executable(self, file_id, path=None):
606
618
path = self.id2path(file_id)
607
619
mode = os.lstat(self.abspath(path)).st_mode
608
620
return bool(stat.S_ISREG(mode) and stat.S_IEXEC & mode)