Overview
| Artifact ID: | d229dd74bf5493e1d1cade14cc8e2609d63fbeb3 |
|---|---|
| Ticket: | 2407783fffffffffffffffffffffffffffffffff
Seek causes IO channel to be shared between all interps |
| User & Date: | sbron on 2008-12-08 22:44:14 |
Changes
- assignee changed to: "hobbs"
- cmimetype changed to: "text/plain"
- comment changed to:
I noticed that 'seek 0' on a file handle makes the handle accessible in all interps. I can't find any evidence in the docs that this is the intended behavior. Example: The following script will dump 2 x four bytes from /dev/random: interp create foo interp create bar set f [open /dev/random rb] interp eval foo { proc bytes {fh} { binary scan [read $fh 4] H* hex puts $hex close $fh } } interp eval bar { proc bytes {fh} { binary scan [read $fh 4] H* hex puts $hex close $fh } } seek $f 0 interp eval foo [list bytes $f] interp eval bar [list bytes $f] close $f Without the seek command it reports an error as expected: can not find channel named "file5" while executing "read $fh 4" (procedure "bytes" line 2) invoked from within "bytes file5" invoked from within "interp eval foo [list byte $f]" SuSE linux 11.0 Kernel 2.6.25.18-0.2-pae Tcl 8.5.5 - foundin changed to: "obsolete: 8.5.5"
- is_private changed to: "0"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "sbron"
- subsystem changed to: "20. [interp]"
- title changed to:
Seek causes IO channel to be shared between all interps
- type changed to: "Bug"