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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Edit a file without changing the modtime
by johnnywang (Priest) on Dec 08, 2004 at 09:24 UTC | |
|
Re: Edit a file without changing the modtime
by kelan (Deacon) on Dec 08, 2004 at 13:30 UTC | |
by brian_d_foy (Abbot) on Dec 08, 2004 at 19:48 UTC | |
by Aristotle (Chancellor) on Dec 20, 2004 at 09:33 UTC | |
by Grygonos (Chaplain) on Dec 08, 2004 at 15:17 UTC | |
|
Re: Edit a file without changing the modtime
by Your Mother (Archbishop) on Dec 08, 2004 at 17:52 UTC |