Log in

No account? Create an account
September 28th, 2005 - Off in the distance
my journal
May 2016

The Bellinghman
Date: 2005-09-28 12:13
Subject: I wonder if I could invoke the DMCA
Security: Public
I'm tickled. I really am.

Way back when, in 1991, I designed and implemented a software program. Of necessity, you could save your work for later use. In this case, I made it load and save textual files. This was so that you could load the saved data into a text editor and fiddle with it by hand if you really really felt like it (and knew what you were doing).

However, back then, reading and parsing text files was not particularly quick, and in a batch production process, anything that could speed up data file reading was going to be a good idea. So I also saved the data in a binary format, which was much quicker to read.

However, you can't hand-edit binary data. Well, not easily, anyway. So, the program went through the following mental steps.

If only the text file existed, it would use it.
If the text file was newer than the binary file, it would use it.
Otherwise, it might consider using the binary file. But it would open it and check for an 8-byte file signature - which had to match - and a compliance level - which had to match. (This requires reading a 10 byte block.)
If either match failed, it would go off and use the text file anyway.

Also, if it ever used the text file, it would immediately spit out a correct version of the binary so that next time, it could use the binary.

In other words, the binary file was a temporary, cached, preparsed version of the text file. If in doubt, delete the binary. As a strategy, it worked fine, though disk i/o speed and text processing has speeded up so much in the meantime that I have since dumped the binary file.

Yesterday, a colleague was brought one of these binary files - but not the text file - and asked to load it. I first ensured that he had a safe copy, and then told him the steps to at least get the program to try to read the binary file. Perhaps unsurprisingly, it didn't load. I'd guess the wrong compliance level. So I asked where it had come from.

The answer - this wasn't actually produced by our software. It was produced by a competitor's software. It just happened to have the same purpose, and the same file extension. Oh, and the same file signature, which was the name of our program and the name of the file extension.

So, ladies and gentleman, one of our competitors liked my temporary file format so much, he reverse engineered it to use as his permanent file format.

(Oh, and the spelling checker wants to replace 'DMCA' with 'YMCA', which would bring a whole different tone to this article.)
2 Comments | Post A Comment | | Link