From: Graham Nicholls <"graham_please, no_spam"@...> Date: 2005-07-06T16:55:45+09:00 Subject: Reading arbitrary data into a c-like structure I mentioned before that I'm writing a tool to extract data from a (dataease) database file according to a schema. In 'C' I'd do something like struct data { char header 4; int recno; char name[30]; char add_1[30]; ... unsigned int cr_limit ; } data; and if I set the compiler options right so the structure was closely packed, I could simply read the file into this structure, and print out the results using printf("%s ... %d\n"data.name, ... data,cr_limit); I looked at struct in Ruby, and I'm perusing the pickaxe, but no idea yet how to do this. I really want to do it in Ruby rather than C because its better at dynamic stuff. Any help much appreciated, thanks GN -- The answer's always "Yes". Now, what was the question? ----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==---- http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups ----= East and West-Coast Server Farms - Total Privacy via Encryption =----