Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Modify text files without changing 'Date Modified'' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Modify text files without changing 'Date Modified'
Authored by: Anonymous on Sep 01, '04 09:42:00PM
Great lil script for when you're editing it locally.

I use a small perl script for when I want to fix something on my webhost (where my blog lives). It's just a little wrapper around stat and the editor of your/my choice (in this case, Pico.)

#!/usr/bin/perl

use File::stat;

$file = $ARGV[0];
if (!defined($file)) {
print "ERROR: Please enter a filename.\n";
}
else {
$mtime = stat($file)->mtime;
system 'pico', $file;
utime time, $mtime, $file;
}
I didn't want to go the plugin route on this either. I like the idea of moddates being used as post dates, but sometimes updates should not "float" to the top which disagrees with Rael's principle design. I don't need everyone to know I fixed a typo, though. :)

-cls

---
---

NOclsSPAM@the-cantina.com

(Remove the appropriate anti-spammy stuff to mail me.)

[ Reply to This | # ]