How can I find out the size of a file

M

Marko.Cain.23

Hi,

How can I find out the size of a file in a disk in python?

i try this, but it does not work:
size = open(inputFileNameDir + "/" + file, 'r').size()

Thank for any help.
 
M

momobear

Hi,

How can I find out the size of a file in a disk in python?

i try this, but it does not work:
size = open(inputFileNameDir + "/" + file, 'r').size()

Thank for any help.

os.stat(filename),
see stat manual for detail.(st_size )
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top