[prog] Reading data file

Daniel. cristofd at hevanet.com
Sun Jan 25 14:31:08 EST 2004


Composite reply:

>There has been a thread about roughly the same topic a while ago
>on Techtalk (?). (I couldn't find it with Google, though).
>There, the program "od" was suggested -- which is short for
>octal dump -- it dumps files in octal/decimal/hexadecimal/whatever
>format. This may be useful here.

Ahhhh. That's good. I should have thought of it, but I was stuck on 
the idea of something a little more specialized that would output the 
number in binary (e.g. as its return value).

>Thanks for all your help and explanations!

Glad it was helpful. :)

>I used the -t u4 instead of -t x4 and that got me the message id in
>the second column and the flags in the third (16 for replied, 32 for
>forwarded and 0 for just read).

This is good if it works, but be careful: if it's ever possible for 
more than one flag to apply to the same message, the number will be 
their sum. For instance, if a message could ever be both replied AND 
forwarded, it'd be 48 instead of 16 or 32. This is where the bitwise 
AND comes in. But if you know that every message has at most one 
flag, there's no need to worry about it.

-Daniel.
-- 
        ()  ASCII ribbon campaign      ()    Hopeless ribbon campaign
        /\    against HTML mail        /\  against gratuitous bloodshed


More information about the Programming mailing list