'error reading datastream' -- loading file only when transfer is complete?
liuliuliu
liuliuliu at gmail.com
Sun May 21 11:06:14 EDT 2006
thanks all. this seemed to work:
import os
stat = os.stat(str(newFiles[index]))
size1 = stat.st_size
pygame.time.wait(100)
stat = os.stat(str(newFiles[index]))
size2 = stat.st_size
while size2 > size1:
size1 = size2
pygame.time.wait(500)
stat = os.stat(str(newFiles[index]))
size2 = stat.st_size
# procede to load complete file
my delay is so long because somehow pygame (or file-writing) runs
relatively slow on maemo/nokia770. even a delay of 400 milliseconds was
too quick to accommodate the slothly rate of an incoming file.
More information about the Python-list
mailing list