gh-83714: Implement os.statx() function (#139178)

Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
This commit is contained in:
Jeffrey Bosboom 2025-10-15 06:44:08 -07:00 committed by GitHub
parent 27acaf1cb7
commit fe9ac7fc8c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 1018 additions and 71 deletions

View file

@ -136,6 +136,8 @@ def _add(str, fn):
_add("HAVE_UNLINKAT", "unlink")
_add("HAVE_UNLINKAT", "rmdir")
_add("HAVE_UTIMENSAT", "utime")
if _exists("statx"):
_set.add(statx)
supports_dir_fd = _set
_set = set()
@ -157,6 +159,8 @@ def _add(str, fn):
_add("HAVE_FPATHCONF", "pathconf")
if _exists("statvfs") and _exists("fstatvfs"): # mac os x10.3
_add("HAVE_FSTATVFS", "statvfs")
if _exists("statx"):
_set.add(statx)
supports_fd = _set
_set = set()
@ -195,6 +199,8 @@ def _add(str, fn):
_add("HAVE_FSTATAT", "stat")
_add("HAVE_UTIMENSAT", "utime")
_add("MS_WINDOWS", "stat")
if _exists("statx"):
_set.add(statx)
supports_follow_symlinks = _set
del _set