Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

read/write binary files in tcl

Status
Not open for further replies.

adekunleadekoya

Programmer
May 19, 2008
30
i need sample code that will read from a binary file like gif and store what is read into a variable and later - supposedly after preprocessing - write back d bytes of data stored in the variable into another binary file.

while the bytes are stored inside the variable i may want to access them byte-by-byte to perform the processing on them before writing them to the second binary binary file
 
fconfigure $fid -translation binary

scan [string range $contents i i] %c strA

above command did the magic

thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top