You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

49 lines
1.2 KiB

puts stdout [chan configure stdin]
chan configure stdin -buffersize 0
puts -nonewline stdout "info script\r\n"
puts stdout "[info script]"
puts stdout "::argc"
puts stdout $::argc
puts stdout "::argv"
puts stdout "$::argv"
puts stdout "NS"
puts stdout "[namespace current]"
after 100
if {[info exists ::test]} {
puts stdout "::test has existing value"
puts stdout "$::test"
}
puts stdout "setting ::test to showargs-ran"
set ::test "showargs-ran"
#puts stdout "doing basic check of stdin for data"
chan configure stdin -blocking 0
set indata ""
if {![chan eof stdin]} {
set indata [read stdin 5]
} else {
puts stdout "stdin eof"
}
#if {[string length $indata]} {
puts stdout "read from stdin:"
puts stdout $indata
#chan configure stdin -encoding utf-32
#chan configure stdin -encoding utf-32be -blocking 0
#chan close stdin
puts stdout 1-[read stdin 10]
set i 100
while {$i > 0} {
incr i -1
after 10
}
chan configure stdin -blocking 1 -encoding utf-32
#puts stdout 2-[read stdin 10]
#chan close stdin read
exit 42
#} else {
#puts stdout "-no stdin data read-"
#}