how to calculate the size of sys.stdin?

Graham Guttocks graham_guttocks at yahoo.co.nz
Wed Apr 11 18:33:50 EDT 2001


Greetings,

Is there a way to calculate the size (in bytes) of sys.stdin?  I tried
to use the "stat" module to accomplish this, but os.stat() seems to
only accept the name of a file.  (i.e, the following doesn't work):

import os,stat
size = os.stat(sys.stdin.read())[stat.ST_SIZE]

Regards,
Graham

_____________________________________________________________________________
http://movies.yahoo.com.au - Yahoo! Movies
- Now showing: Dude Where's My Car, The Wedding Planner, Traffic..




More information about the Python-list mailing list