Does ftruncate work?

Damien Elmes resolve at repose.REMOVE.cx
Fri Jan 11 00:40:35 EST 2002


bass at slinkp.com (Paul Winkler) writes:

> Can somebody tell me what's wrong here?
> 
> [pw at slink pw]$ touch foo
> [pw at slink pw]$ python
> Python 2.1.1+ (#1, Jan  8 2002, 00:37:12) 
> [GCC 2.95.4 20011006 (Debian prerelease)] on linux2
> Type "copyright", "credits" or "license" for more information.
> >>> import os
> >>> print os.ftruncate.__doc__
> ftruncate(fd, length) -> None
> Truncate a file to a specified length.
> >>> f = open('foo', 'rw')
> >>> os.ftruncate(f, 1)

f.fileno()

-- 
Damien Elmes
resolve at repose.cx



More information about the Python-list mailing list