Re: get_file_size

Discussion in 'Python' started by Egor Bolonev, Jun 30, 2003.

  1. Egor Bolonev

    Egor Bolonev Guest

    > > f=open('1','wb')
    > > print len(f)

    > You don't need to open the file to get its size. The file's size is
    > stored in the directory metadata about the file, along with its
    > modification time, file name, permissions, etc.

    How about that?
    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)?
    Egor Bolonev, Jun 30, 2003
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page