From: Bryan O. <br...@bi...> - 2002-09-12 03:17:16
|
I've noticed some strange behavior with AquaTk related to stdin. The nutshell summary is, if I pipe data to a wish script, the script can't read it. Consider the following script, condensed from a real world example that works on windows, unix, and mac with X11: if {[lindex $::argv 0] == "-"} { set message [read stdin] } else { set message [lindex $argv 0] } wm withdraw . tk_messageBox -message $message exit With AquaTk, running the command with "echo foo | wish dialog.tcl -" results in nothing appearing in the dialog (FWIW, wish is aliased to the wish.app, but I get the same results if I fully qualify wish). However, if I run the command as simply "wish dialog.tcl -" and type data in the terminal window terminated with ^D, it *does* show the message. So, apparently AquaTk can read from stdin if stdin is the terminal, but cannot if stdin is a pipe. Does anyone know if this is some sort of fundamental limitation of the mac, or just a bug in AquaTk? I'd hate to lose the ability to pipe data to a wish application. --bryan |