This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

fconfigure in gnu-win32?


Reply-To: dslate@interaccess.com
To: gnu-win32@cygnus.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@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]