Joshua Oreman wrote: > > >I would say, use select(2). > > >Is there a reason this wouldn't work? > > > > Select doesn't work with files. > > Really? `man 2 select' says nothing about that. It just talks about > 'file descriptors'. Now if it said 'socket descriptors' or 'non-file > file descriptors' I would understand, but I don't think that that statement > is implied by the man page. Is there something I'm missing?
Select blocks on readfds if a read from the file would block; that is never the case with a file: you will either get data, or you will get an EOF. Select blocks on writefds if a write to the file would block; that is never the case with a file: you will either successfully write, or you will get an error, e.g. as a result of exceeding quota, etc.. Therefore a select for reads or writes on a disk file should always return true. -- Terry _______________________________________________ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"