MCPcopy Index your code
hub / github.com/python/cpython / _stat

Method _stat

Lib/pathlib/__init__.py:633–652  ·  view source on GitHub ↗

Return the status as an os.stat_result.

(self, *, follow_symlinks=True)

Source from the content-addressed store, hash-verified

631 return f"<{path_type}.info>"
632
633 def _stat(self, *, follow_symlinks=True):
634 """Return the status as an os.stat_result."""
635 if self._entry:
636 return self._entry.stat(follow_symlinks=follow_symlinks)
637 if follow_symlinks:
638 if not self._stat_result:
639 try:
640 self._stat_result = os.stat(self._path)
641 except (OSError, ValueError):
642 self._stat_result = _STAT_RESULT_ERROR
643 raise
644 return self._stat_result
645 else:
646 if not self._lstat_result:
647 try:
648 self._lstat_result = os.lstat(self._path)
649 except (OSError, ValueError):
650 self._lstat_result = _STAT_RESULT_ERROR
651 raise
652 return self._lstat_result
653
654 def exists(self, *, follow_symlinks=True):
655 """Whether this path exists."""

Callers 9

existsMethod · 0.95
is_dirMethod · 0.95
is_fileMethod · 0.95
is_symlinkMethod · 0.95
_posix_permissionsMethod · 0.95
_file_idMethod · 0.95
_access_time_nsMethod · 0.95
_mod_time_nsMethod · 0.95
_bsd_flagsMethod · 0.95

Calls 2

lstatMethod · 0.80
statMethod · 0.45

Tested by

no test coverage detected