I'd like to implement a Tcl command that takes as its parameter some binary data expressed in hex format. Is there a way using core tcl syntax to pass binary data to a command or do I have to invent a notation?
For example, I would like to invoke the command with a parameter such as "a\x00\c" and have the implementation of the command get 3 bytes: an 'a', a NULL, and a 'c'. But, since every parameter is just a string, the NULL acts as a string terminator.
Any ideas are appreciated.
Thanks,
--etan
============================================================
Etan Orlian Network Operations Technologies Lab
Phone:(914) 644-2178 NYNEX Science and Technology
Fax :(914) 949-9566 400 Westchester Avenue
et...@nynexst.com White Plains, NY 10604
According to Etan Orlian <et...@nynexst.com>:
:Hi!
:
:I'd like to implement a Tcl command that takes as its parameter some
:binary data expressed in hex format. Is there a way using core tcl syntax
:to pass binary data to a command or do I have to invent a notation?
There is no way for the core tcl to pass directly data which contains
a 0x00.
You could however use a 'handle' type approach where you pass along strings
which 'point' to the real binary data.
--
:s Larry W. Virden INET: lvi...@cas.org
:s <URL:http://www.teraform.com/%7Elvirden/> <*> O- "We are all Kosh."
:s Unless explicitly stated to the contrary, nothing in this posting should
:s be construed as representing my employer's opinions.
Cameron Laird http://starbase.neosoft.com/~claird/home.html
cla...@NeoSoft.com +1 713 623 8000 #227
+1 713 996 8546 FAX
Okay, sure, throw the FAQ back in my face <grin>. Note that if you
check <URL:http://www.teraform.com/%7Elvirden/tcl-faq/part5.html> for
several extensions which address the issue of binary data.