Should tcl variables learn in the future to hold binary data?
Best regards
Dieter
We could also do some fancy things like
insert into <TEXT-type-object> select * from <BLOB-type-object>
allowing the data to be converted !
Thus you could do things like
set x "F7F7F7F7AA0133"
and interpret it.
--
Kumar Srinivas
Another idea is the ASC85 encoding that is in the PixScript II
spec. This encapsulates 4 binary bytes in 5 printable bytes.
The code to map back and forth is pretty trivial.
-Ron
: Should tcl variables learn in the future to hold binary data?
Yep, this is gonna happen RSN (John recently said that binary I/O would
be part of Tcl 7.6). In the meanwhile you have at least two options:
- write a minimal set of functions necessary to access the mmdb, and make
them available to Tclland
- use "read $stream 1" to read the input stream characterwise, then
compare each read character against the empty string (which will
return 1 in case of null bytes)
I'm also pretty sure that some Tcl extensions can handle binary I/O, so
snarfing through the Tcl archives and the FAQ might be helpful, too.
mike
We employ some internal representation for binary records,
using a hash table per "record type" to map "field names" to offset and datatype.
Arrays and other structured fields are simply mapped to composed names like a.b and c,4 .
Such an internal description is built by a tcl command taking a list of name-type pairs.
The record may be realized either by tracing some tcl array,
which gives a very builtin look using set and $ substition and enables proc scope,
or as a command, which is more OO like and less "dirty trick".
Maybe we can make some source publicly available ...
--
Klaus Ripke fon: +49-30-467007 92
SOFTWERKer GmbH Berlin fax: +49-30-467007 93
Gustav Meyer Allee 25, 13355 mail: ri...@softwerker.de