From: Fabio Vitale Date: 2006-07-17T19:54:35+09:00 Subject: How can I parse binary files? I've the need to parse a binary file with the following structure: How can I accomplish this in Ruby? Header (36 bytes): - Version (4 byte unsigned integer) currently 1 - UIDValidity (4 byte unsigned integer) - UIDNext (4 byte unsigned integer) - Last Write Counter (4 byte unsigned integer) - the rest unused Message data (36 bytes per message): - Filename (23 bytes including terminating NUL character) - Flags (1 byte bitmask) - UID (4 byte unsigned integer) - Message size (4 byte unsigned integer) - Date (4 byte time_t value) Flags mask is 1:Recent, 2:Draft, 4:Deleted, 8:Flagged, 16:Answered, 32:Seen. -- Posted via http://www.ruby-forum.com/.