So I guess I didn't have a complete understanding of poll, I thought
it returned file descriptors that had registered an event that the
user asked to watch for.  In my case, select.POLLIN
Constant        Meaning
POLLIN  There is data to read

...there ins't any data to be read.  The file is readable, yes, but is
that all that the syscall has to offer?


On Feb 11, 6:49 pm, Jean-Paul Calderone <exar...@divmod.com> wrote:
> On Wed, 11 Feb 2009 18:44:53 -0800 (PST), birdsong <david.birds...@gmail.com> 
> wrote:
> >I'm pretty sure I've exhausted all searches and read all the forums
> >Google will turn up related to this issue.
>
> >I touch an empty file in a sh shell, fire up the python shell, open
> >the file for reading(tried all buffering options), register it with a
> >poll object for select.POLLIN and call poll(), but the poll never
> >blocks and always returns for the FD, EVENT combination I ask for, but
> >the file has not anything written to it.
>
> Filesystem files are always reported as readable and writeable by select,
> poll, epoll, etc.
>
> If you want to do non-blocking filesystem I/O, your choices are to use a
> native thread (Python's threading module, or another third-party module
> which wraps the platform thread API) or to use POSIX AIO (or the mildly
> incompatible Linux variant.  Of course, AIO has tons of caveats and is
> generally in a miserable state, so you probably shouldn't use it.  That
> leaves you with threads.
>
> Jean-Paul

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to