[Zope] python: file size screw up????
Tue, 30 Jul 2002 04:43:00 -0700
I am creating a zip file on the fly on the local file system and sending
it back to the browser via an external method. This the following that I
do for that (thanks to Jan and Chris M.):
zip_size = stat(zip_file_name+'.zip')[ST_SIZE]
zip_file = open(zip_file_name+'.zip')
zip_data = zip_file.read()
Everything works perfectly .... EXCEPT :
the file size, when I look up up the properties of the downloaded file,
it says its 595 bytes in size but size on disk is 4K (which is
correct)... Of course since the file size is screwed up my zip utility
goes nuts!!! After some minor tinkering I found that...
the stat.ST_SIZE is not the same as len(zip_file.read())
stat.ST_SIZE = 4k (correct)
len(zip_file.read()) = 595 b (why ... oh why...)
what is going on here?? shouldnt they be the same?? any pointers ....
Neurobehavioral Systems Inc, 828 San Pablo Ave, Albany, CA 94706
(R) 510 7696011 (M) 510 3014871 (O) 510 5279231
"I saw `cout' being shifted "Hello world" times to the left and
stopped right there!!" -- Steve Gonedes