[Gambas-user] Watching File and Pipe

Tobias Boege taboege at ...626...
Mon Jan 7 16:32:12 CET 2013


On Mon, 07 Jan 2013, Beno?t Minisini wrote:
> Le 07/01/2013 12:27, Beno?t Minisini a ?crit :
> > Le 06/01/2013 11:32, Tobias Boege a ?crit :
> >>>> that the File_Read() event is called without end
> >>>
> >>> Logical, as a normal file is always ready to be read.
> >>>
> >>
> >> The doc says: "If at least one byte can be read". This statement is IMHO
> >> ambiguous. I expected the Read() event to be raised when Lof(hFile) > 0.
> >> Do you think this sentence needs clarification?
> >
> > Logically the Read event should not be raised if the file pointer is at
> > the end of file, but this is managed by the kernel, so I can't be sure!
> >
> 
> OK. Here is what the manpage of 'select' says:
> 
> 	Three independent sets of file descriptors are watched. Those
> 	listed in 'readfds' will be watched to see if characters become
> 	available for reading (more precisely, to see if a read will
> 	not block; in particular, a file descriptor is also ready on
> 	end-of-file)
> 
> So even if we are on end-of-file, the Read event will be raised!

OK. Sorry for the false positives.

FYI, I felt to mention that Gambas uses select() in the documentation. This
would clarify the situation to most people, I think.

Regards,
Tobi




More information about the User mailing list