Subject: Pipe with TCL/TK
From: [email-masked] (Utilisateur genesis)

7 Apr 1998 08:42:44 -0700
Message-ID: <[email-masked]>
To: [email-masked]
Cc: [email-masked]

Hi,

I use TCK/TK with GNUWIN32-B19. My application use Tcl functions libraries to send Tcl and Tk commands.
I use pipe to interprocess communication, and I want to detect when a pipe may be read.
For that I created pipe with "pipe" function, and started a function handler "action_pipe" (for execute a callback when pipe may be read).

   int fid[2];
   Tcl_Channel pipe_channel;
#ifdef _WIN32
   HANDLE pipe_handle;
#else
   int pipe_fd;
#endif

   pipe (fid);
#ifdef _WIN32
   pipe_fd = get_osfhandle(fid[0]);
#else
   pipe_fd = fid[0]; 
#endif
   pipe_channel = Tcl_MakeFileChannel ( pipe_fd TCL_READABLE );
   Tcl_CreateChannelHandler ( pipe_channel, TCL_READABLE,          
                               action_pipe, (ClientData) fid[0] );

I've the same source code for SUN Solaris 2.5 and Windows NT GNUWIN32-B19. I've TCL/TK 8.0 on both platforms. I use -D_WIN32 compilation option on Windows. 

I've no problem on SUN platform, the handler "action_pipe" is activate when a pipe may be read.
On Windows platform my application block when the TCl/TK event loop is started.

I post this message to this mailing list because I saw some CYGNUS comments in TCL source code of GNU-B19 about pipe creation in tclWinPipe.c.
I hope someone can help me to understand why in this example on WIN32 my application block.
Otherwise, I search on WIN32 platform an other solution to detect when a pipe may be read.

Thanks.

Jean-Luc CAMES.
-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".