From: Farrel Lifson Date: 2006-12-07T21:44:38+09:00 Subject: Re: How to unpack unusual binary structure? On 07/12/06, Leo -- wrote: > Farrel Lifson wrote: > > Have you looked at String#unpack ? > > Yes, but I do not know how to apply it in the case of packed data > structure. I'm not much into CS, so if this is possible with > String#unpack I will be very happy if you can help me with format string > to unpack this "pragma pack(1)" data structure. > > -- > Posted via http://www.ruby-forum.com/. > > This is just a guess and I'm not sure what time_t is but if we assuume it's an unsigned int then you could say: ctm,open,low,high,close,vol = packedData.unpack("Iddddd") Farrel