File IO with select?

Greg Ewing see at my.signature
Wed Jul 12 20:17:23 EDT 2000


Jared Lee Peterson wrote:
> 
> I am trying to syncronize two clients that are accessing the same file.
> I am trying to use
> select() for this but I am not having much luck.

select() is useless for that, because reading from an
ordinary file never blocks, so select() will always
return immediately.

On unix, the only portable way is to periodically
poll the file to see if it has grown. I gather that
there is another way on Windows, but I don't know
any details.

-- 
Greg Ewing, Computer Science Dept, University of Canterbury,	  
Christchurch, New Zealand
To get my email address, please visit my web page:	  
http://www.cosc.canterbury.ac.nz/~greg



More information about the Python-list mailing list