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

@ -200,6 +200,21 @@ def filemode(mode):
FILE_ATTRIBUTE_VIRTUAL = 65536
# Linux STATX_ATTR constants for interpreting os.statx()'s
# "stx_attributes" and "stx_attributes_mask" members
STATX_ATTR_COMPRESSED = 0x00000004
STATX_ATTR_IMMUTABLE = 0x00000010
STATX_ATTR_APPEND = 0x00000020
STATX_ATTR_NODUMP = 0x00000040
STATX_ATTR_ENCRYPTED = 0x00000800
STATX_ATTR_AUTOMOUNT = 0x00001000
STATX_ATTR_MOUNT_ROOT = 0x00002000
STATX_ATTR_VERITY = 0x00100000
STATX_ATTR_DAX = 0x00200000
STATX_ATTR_WRITE_ATOMIC = 0x00400000
# If available, use C implementation
try:
from _stat import *