[Tutor] clipping file to size ?

Kent Johnson kent37 at tds.net
Mon Jun 9 15:34:42 CEST 2008

On Mon, Jun 9, 2008 at 9:04 AM, dave selby <dave6502 at googlemail.com> wrote:
> writing smaller file...
> and I end up with the remnants of the old larger file at the end.
> any idea how to clip the file to the newer smaller size without
> closing it and reopening it as a 'w' ?

f.truncate() ?

Why not re-open the file?


More information about the Tutor mailing list