Shallow Thoughts

Akkana's Musings on Open Source, Science, and Nature.

Tue, 15 Feb 2005

Blogedit -- edit a file without altering the date

Lots of Linux blogging software, such as the pyblosxom I'm currently using, uses the Unix file date on for each posting to determine the date at which the entry was made.

This makes it very convenient to add new entries, but it also makes it tricky to go back and update an old entry without losing all information about when the entry was originally posted.

I've been using a little sh script I hacked up for the purpose, which parsed the output of ls -l and then passed that in to touch -d. It worked, but it was ugly and had problems with postings that crossed a year boundary or were too old (because the ls -l format varies).

I finally got around to rewriting the script in python. It's more robust now, and cleaner, plus it checks EDITOR and VISUAL instead of always using vi. blogedit

Tags:
[ 22:51 Feb 15, 2005    More blogging | permalink to this entry ]