[Gambas-user] Watching File and Pipe

Tobias Boege taboege at ...626...
Sun Jan 6 02:20:02 CET 2013


Hi Benoit,

here's the story: I originally wanted to redirect the Error instruction's
default stream to a pipe which I could then read from in the same
application. For some reason I got a "Bad file descriptor" (must be EBADF?)
error when using

Error "test"

after having redirected

Error To #File.In

I am used to stdin being open and writable but maybe things are different in
graphical applications - would be logical; I don't know...

However, it didn't work so I tried with a temporary file - I simply needed a
stream with one read and one write end.

The problem now is, when I try to watch a File or Pipe created using either

hFile = Open sPath For Input Output Create Watch

or

hPipe = Pipe sPath For Read Write Watch

that the File_Read() event is called without end and Pipe_Read() is never
called.

Moreover, the Pipe seems to raise the File_Read() event and not the
Pipe_Read() one and the file does not raise either event. The combination of
the creation flags does _not_ seem to be the reason. I got the same results
when using distinct read and write streams for both of them.

It's rather late already. I hope I'm not going bananas or oversee some
obvious mistakes here... (Well, using a single File for both operations may
actually be total nonsense. Please CMIIW.)

Regards,
Tobi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: file_and_pipe_watch-0.0.1.tar.gz
Type: application/octet-stream
Size: 6017 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20130106/9b9fbee9/attachment.obj>


More information about the User mailing list