get_file_size

Martin v. Löwis martin at v.loewis.de
Sun Jun 29 23:41:44 EDT 2003


"Egor Bolonev" <ebolonev at mail.ru> writes:

> How about that?
> f=open('1','wb')
> f.write(something)
> print len(f)
> Should I close file for get it size or should I write a C-like function with
> seek(end),tell, seek(old)?

No. You should use os.fstat, or os.stat if you still remember the file
name.

Regards,
Martin




More information about the Python-list mailing list