in reply to pack function

You haven't specified a format for the binary file. With data like that, why isn't just ASCII good enough? Let the other programs that need to understand this data parse the ASCII into their own internal format...why not? There can be huge advantages to having a "human readable" data interchange format. Nowadays squeezing the data into the minimum number of bytes just isn't as important as it used to be.