Windows ginput function [Was: fopen doesn't return when opening a fifo!!]
David Bateman
David.Bateman at motorola.com
Thu Apr 3 02:42:39 CDT 2008
John W. Eaton wrote:
> | Additionally what if the user is a fast clicker, and is faster than the
> | arbitrary 0.1s delay. This will result in missed clicks.. I therefore
> | thinks its better to not sleep, or use blocking reads.
>
> I don't understand why there would be missed clicks, but maybe I'm
> missing something about the implementation in gnuplot. Wouldn't the
> information about the clicks be written to the output regardless of
> what Octave is doing? Oh, I see now, we are only catching one click
> for each "pause mouse any" command. Never mind.
>
The reason is that the ginput command issues a "pause mouse any" to
gnuplot and then accepts the next click. If Octave doesn't issue the
next "pause mouse any" before the user clicks then the click will be lost.
> | I believe the attached patch should work as you'd like it to.
>
> OK, I applied it.
>
> Instead of checking ispc(), maybe we should just try mkfifo and see
> whether it works and if not, use in-line communication? Check the
> definition of file_ops::mkfifo in liboctave/file-ops.cc. If the
> mkfifo system call is not available, mkfifo should return err == -1
> and msg == "mkfifo: not supported on this system".
>
Cygwin has a mkfifo function. However its a stub, so the test for the
existence of mkfifo on cygwin will succeed, but it wont later work as
expected. This is why I tested on ispc() rather than for HAVE_MKFIFO in
the config.
D.
--
David Bateman David.Bateman at motorola.com
Motorola Labs - Paris +33 1 69 35 48 04 (Ph)
Parc Les Algorithmes, Commune de St Aubin +33 6 72 01 06 33 (Mob)
91193 Gif-Sur-Yvette FRANCE +33 1 69 35 77 01 (Fax)
The information contained in this communication has been classified as:
[x] General Business Information
[ ] Motorola Internal Use Only
[ ] Motorola Confidential Proprietary
More information about the Bug-octave
mailing list