On this page
posix.fstat
Prev: posix.fspath | Up: posix | Next: posix.fstatvfs
Rel: posix.abort, posix.access, posix.chdir, posix.chflags
Ref: docs.python.org — posix.fstat
Tags: #public #python3 #stdlib #posix
Import
import posix
from posix import fstat
Signature & Overview
posix.fstat(fd)
Perform a stat system call on the given file descriptor.
Usage
import os, tempfile
with tempfile.TemporaryFile() as f:
assert os.fstat(f.fileno()).st_size == 0
Gotchas
- Race-free stat on an open fd.
REPL Inspect
from posix import fstat
help(fstat)
Linked from
Related notes
- tuts/python3/stdlib_module/posix/fspath Linked here; links to this page; shared tags: #posix, #stdlib
- tuts/python3/stdlib_module/posix/fstatvfs Linked here; links to this page; shared tags: #posix, #stdlib
- tuts/python3/stdlib_module/posix Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/posix/abort Linked here; shared tags: #posix, #stdlib
- tuts/python3/stdlib_module/posix/access Linked here; shared tags: #posix, #stdlib
- tuts/python3/stdlib_module/posix/chdir Linked here; shared tags: #posix, #stdlib
- tuts/python3/stdlib_module/posix/chflags Linked here; shared tags: #posix, #stdlib
- tuts/python3/stdlib_module/posix/chmod shared tags: #posix, #stdlib
- tuts/python3/stdlib_module/posix/chown shared tags: #posix, #stdlib
- tuts/python3/stdlib_module/posix/chroot shared tags: #posix, #stdlib