On this page
os.stat_result
Prev: os.stat | Up: os | Next: os.statvfs_result
Rel: os.abort, os.access, os.chdir, os.chmod
Ref: docs.python.org โ os.stat_result
Tags: #public #python3 #stdlib #os
Import
import os
from os import stat_result
Signature & Overview
os.stat_result(iterable=(), /)
stat_result: Result from stat, fstat, or lstat.
Methods & Attributes
stat_result.count(self, value, /)โ Return number of occurrences of value.stat_result.index(self, value, start=0, stop=9223372036854775807, /)โ Return first index of value.
Usage
import os
st = os.stat(".")
assert isinstance(st, os.stat_result) and st.st_mode > 0
Gotchas
- Returned by
os.stat(),os.lstat(), andPath.stat(): Usest_mtime_nsfor nanosecond precision andstatmodule helpers (stat.S_ISREG(st.st_mode)) to decodest_mode.
REPL Inspect
from os import stat_result
help(stat_result)
Linked from
Related notes
- tuts/python3/stdlib_module/os/stat Linked here; links to this page; shared tags: #os, #stdlib
- tuts/python3/stdlib_module/os/statvfs_result Linked here; links to this page; shared tags: #os, #stdlib
- tuts/python3/stdlib_module/os Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/os/abort Linked here; shared tags: #os, #stdlib
- tuts/python3/stdlib_module/os/access Linked here; shared tags: #os, #stdlib
- tuts/python3/stdlib_module/os/chdir Linked here; shared tags: #os, #stdlib
- tuts/python3/stdlib_module/os/chmod Linked here; shared tags: #os, #stdlib
- tuts/python3/stdlib_module/os/chown shared tags: #os, #stdlib
- tuts/python3/stdlib_module/os/close shared tags: #os, #stdlib
- tuts/python3/stdlib_module/os/cpu_count shared tags: #os, #stdlib