Automagically Updating the Last Updated Line

I noticed that many people put in lines into their HTML files that said when the file was last updated. However, whenever I edited my file I would forget to update this last updated line. So, I figured that I should write something to do this quickly and easily.

First off, you need to be using the NCSA HTTPD server for the document that you wish to insert this into automatically. Next, you need to use a server side include directive to use the result of the little program I wrote.

So, now compile the thing I wrote, which I call last_updated.c. Try it out on a few files, and it should return the time that the file was last updated. Now we are ready to put the server side include directive with our nifty new program in.

Here's basically what the last updated line looks like on my work home page:

<I>Last updated <!--#exec cmd="/zu/boogles/public_html/last_updated /zu/boogles/public_html/automagic_update.html"--><I> <P>

So, that's it! Now you'll never have to worry about that line getting out of sync again.

Note: I haven't cleaned up the source for last_updated.c yet, so if you can help me do this it would be much appreciated. I use a lot of my own includes and magic and stuff, so it probably won't compile directly on your system. It does involve a minimum of C hacking to get it working, since the program is so small. So, if you have any improvements to incorporate, I'd be happy to make them available to everyone.


boogles@martigny.ai.mit.edu