Re: async file i/o



David Helder wrote:

O_NONBLOCK should work.  E.g.:
  state->fd = open (state->pathname, O_RDONLY | O_NONBLOCK);

Then you can use select() or create an IOChannel from the file handle and
use g_io_channel_add_watch().

I just wrote a small program using glade to read a file from a floppy in
4096 byte chunks, using O_NONBLOCK and GIOChannel. It blocks. :(

-M




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]