Monday 19th May 2003
Parsing Around
Well, last week had a fair amount of work for the usual suspects, with a few interesting anecdotes. Security can be remarkably ignorant sometimes, as Andy T and I found to our amusement. Unfortunately, they can also stare in the right direction occaisionally; into space perhaps, but that’s all that was needed to curtail one expedition. But as time goes on, I find more and more places "just like that bit in Half-life where…"
This weekend and today I have been mainly swearing, thinking too hard and pulling my hair out. Here’s a tip for you all - if you ever find yourself faced with an undocumented, unreliable (both in missing or optional data blocks, and fluctuating data labels), ‘Human Friendly’ file format, which is merely stdout printfs of a program redirected into a text file (and so barely even qualifies as a file format), and are asked to parse it using C (oh, go on, with the help of glib 1.0, but nothing else), then run a mile. Did I forget to mention that these files can be easily 1,405,182 lines long (no, that’s not a random number, meet my bayer_dz_md file), and that your text viewer of choice (remember, you need to work out the file format as you go along, so a text viewer and multiple examples are a necessity) has to cope with 50MB files without barfing? Fun stuff, I assure you. Actually, if you’ve any sense, you’ll make sure that I don’t get a chance to assure you. ("Don’t mention the project - I mentioned it once, but I think I got away with it!")