Blosxom dates entries by file modification times, which really sucks if I want to update a post but leave the time as it is. It may have some plugin or entries file or other gizmo to maintain the modification times of each entry, but I wanted something that didn't make me break my blosxom installation, install something new, or change what I was doing.

So, I just wrapped a call to the editor in a little Perl script that remembers the modification time, edits the file, and resets the time when it's done.

#!/usr/bin/perl my $time = -e $ARGV[0] ? (stat $ARGV[0])[9] : time; system '/usr/bin/pico', $ARGV[0]; utime $time, $time, $ARGV[0];

No big whoop, or maybe merely a "Almost cool" use of perl: just something I should have done a while ago.

--
brian d foy <bdfoy@cpan.org>

Replies are listed 'Best First'.
Re: Edit a file without changing the modtime
by johnnywang (Priest) on Dec 08, 2004 at 09:24 UTC
    That's cool. I had the same problem with Blosxom, and I kept a (relatively small) set of timestamps in a simple bash script, and simply "touch" everything with it. I found it's quite convenient to cheat the date, or re-arrange the blogs to fill up some lazy periods (barring straight links.)
Re: Edit a file without changing the modtime
by kelan (Deacon) on Dec 08, 2004 at 13:30 UTC

      I use pico to edit blosxom entries and write mail (since it's the editor behind PINE). I like it much better for creating paragraphs and sentences and such.

      If I'm editing at a terminal for anything else, it's a vi variant.

      For some stuff for The Perl Review, I use TextEdit because I need RTF, and I only need to write a screenful.

      But what I really use is BBEdit.

      What I really don't use is emacs. Randal does everything in emacs and constantly talks about how he'd like to dump Mac OS X and let emacs do everything. Okay, maybe he doesn't say that, but I know he's thinking it.

      --
      brian d foy <bdfoy@cpan.org>

        Well, Emacs is a nice [and we all know how the rest goes].

        Makeshifts last the longest.

      if you take pico to colorado and colorado to las palmas.. that's how you get to "llama" school... fairly prophetic i think.

Re: Edit a file without changing the modtime
by Your Mother (Archbishop) on Dec 08, 2004 at 17:52 UTC