PyDocs

Nav

Generic Operating System Services

IOBase.truncate

io

method of IOBase
  • IOBase.truncate(size=None, /)
Truncate file to size bytes.

File pointer is left unchanged.  Size defaults to the current IO
position as reported by tell().  Return the new size.
Changed in 3.5
  • 3.5: Windows will now zero-fill files when extending.
0 Examples
No examples for io/IOBase.truncate.
See Also
No see-alsos for io/IOBase.truncate
0 Notes
No notes for IOBase.truncate