os.path.getsize() on Windows

"Martin v. Löwis" martin at v.loewis.de
Fri Mar 21 16:49:00 EDT 2008


> def isGrowing(f, timeout):
>         ssize = os.path.getsize(f)
>         time.sleep(timeout)
>         esize =os.path.getsize(f)
>         return esize != ssize
> 
> On windows, this returns the size of the file as it _will be_, not the
> size that it currently is. 

Why do you say that? It most definitely returns what the size currently
is, not what it will be in the future (how could it know, anyway).

Regards,
Martin



More information about the Python-list mailing list