'error reading datastream' -- loading file only when transfer is complete?

liuliuliu at gmail.com liuliuliu at gmail.com
Sat May 20 18:59:47 EDT 2006


thanks - i'm looking, but i found this as well. actually, does this
work?

import os
os.access(file, os.R_OK) # is it readable?

is this valid:

{ i have my file identified }
isFileAccessible = os.access(file, os.R_OK)
while !isFileAccessible:
     isFileAccessible = os.access(file, os.R_OK)

and then whenever it's true it can only then proceed to load the file?

thanks, christine

Andrew Robert wrote:
> liuliuliu at gmail.com wrote:
> > hello --
> >
> > i'm running python/pygame on maemo (nokia 770). my situation is that
> > i'm continually scouring this one directory for incoming files. if i
> > see if there's a new file (coming in via wireless scp), i proceed to
> > load it and process it.
> >
> > however, i think i am running into the issue that my program starts to
> > load the file after it recognises there is new data, but before the
> > file has completely transferred, so at unpredictable times i get a
> > pygame.error: Error reading from datastream.
> >
> > what is the easiest way to work out this issue? easy being the key
> > word. :) thank you very much!
> >
> > christine
> >
> 
> You might want to test for file locking before attempting to use




More information about the Python-list mailing list