delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/09/10/14:03:19

From: dslate AT interaccess DOT com ("David J. Slate")
Subject: fconfigure in gnu-win32?
10 Sep 1997 14:03:19 -0700 :
Approved: cygnus DOT gnu-win32 AT cygnus DOT com
Distribution: cygnus
Message-ID: <199709100927.EAA00928.cygnus.gnu-win32@pc4.prs.nunet.net>
Original-To: dslate AT interaccess DOT com, gnu-win32 AT cygnus DOT com
Original-Sender: owner-gnu-win32 AT cygnus DOT com

Reply-To: dslate AT interaccess DOT com
To: gnu-win32 AT cygnus DOT com
Subject: fconfigure in gnu-win32?

Does anyone know whether the non-blocking I/O features of Tcl/Tk are fully
functional in gnu-win32?  The following code fragment sets up non-blocking
I/O with a program called cprogram:

	set prog cprogram
	set ProgFile [open "| sh -c \"($prog) \"" r+]
	fconfigure $ProgFile -blocking 0
	fileevent $ProgFile readable { incr ProgLineCount }

and the following does the actual read:

	tkwait variable ProgLineCount
	if { [gets $ProgFile line] < 0 } {
	        if { ! [eof $ProgFile] } {
	                continue
	        }
	        Die "End-of-file from prog"
	}
	incr ProgLineCount -1

The above code works ok on Linux/Unix, but gets a premature eof in gnu-win32
on Windows-95 or Windows-NT.

Thanks,

-- Dave Slate
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019