disksuage question, stat.py

Padraig at Linux.ie Padraig at Linux.ie
Mon Feb 3 14:26:27 CET 2003


Padraig at Linux.ie wrote:
> I'm not exactly sure what you want, but I use the following
> to get the disk usage of a file:

stupid mozilla, that should be:

import os, stat
st=os.lstat(path)
size=st.st_blksize*(st.st_blocks/(st.st_blksize/512))

Pádraig.





More information about the Python-list mailing list