How do I kill an empty file ??

bowman bowman at montana.com
Tue Jan 23 21:43:37 EST 2001


<chris.nelson at bwc.state.oh.us> wrote in message
news:94k9p5$vs2$1 at nnrp1.deja.com...
> Ultimately I'm looking for sytax that will
> ignore processing a file if it is empty.

os.stat(file) will yeild a tuple including st_size. the stat module defines
indices, so

if  os.stat(file)[ST_SIZE] == 0:
    pass

or somesuch







More information about the Python-list mailing list