[Pythonmac-SIG] Getting the file sizes form the OS

Chris Barker cbarker@jps.net
Mon, 18 Sep 2000 12:36:24 -0700


Hi,

I wrote a little utility that writes a list of files and their sizes out
to a text file. I used os.xstat to get the size of the file and the
resource fork. What I want is the same numbers that the finder shows,
and I'm not getting that. I tried adding the sizes of the file and the
resource fork together, and go tclose, but not the same. It does seem to
work for simple (large) data files with no resource fork.

Is there a way to query the finder, or MacOS to get the file size as
listed by the finder, other than os.xstat?

thanks,

-Chris

-- 
Christopher Barker,
Ph.D.                                                           
cbarker@jps.net                      ---           ---           ---
http://www.jps.net/cbarker          -----@@       -----@@       -----@@
                                   ------@@@     ------@@@     ------@@@
Water Resources Engineering       ------   @    ------   @   ------   @
Coastal and Fluvial Hydrodynamics -------      ---------     --------    
------------------------------------------------------------------------
------------------------------------------------------------------------