ID EN
OS

truncate

Python 3.11

Truncate the file corresponding to path, so that it is at most length bytes in size.

Syntax

PYTHON
os.truncate(path, length)

See Also

specifying a file descriptor auditing event Availability path-like object