i need to read the contents of a file (could be 100kb, could be 500mb,
From: email@example.com [mailto:firstname.lastname@example.org] On Behalf Of Craig W
Sent: Friday, January 27, 2006 3:58 PM
Subject: [Jython-users] read file and allow cancel
could be 1gb)...but I want to allow the read to be canceled.
for example, say a user wants to savea file...as it's saving they want
to terminate it...thus stop the read.
I was doing this:
# return whether reading should continue
data = 
f = open('somefile.zip', 'rb')
while len(data) < sizeOfFile and keepReading():
....however, this seems to work in python (not in jython, where I get
OutOfMemoryError). Any suggestions on how to approach this with
perhaps a better way?