Script

Touch

My main Revolution & On-Rev pages do not change often, because most changes are in the example stacks & scripts, whose listings are generated on the fly.
The problem with this is that the page then appears to be older than it's contents.
So I need a way to update a page's modification date even when it does not change.
This page is testing using the 'touch' shell command to do this.
Whenever this page is loaded or refreshed, it updates it's own modification date to the current date and time.

Before touching:

This script was last modified on: Thu, 29 Jul 2010 08:32:00 -0500 (Local time: Thu, 29 Jul 2010 23:32:00 +1000)

-rw-r--r-- 1 troz troz 2061 Jul 29 08:32 /home/troz/troz.net/onrev/samples/touch.irev

Using the shell command:


command: touch /home/troz/troz.net/onrev/samples/touch.irev

'touch' result: 0

After touching:

This script was last modified on: Sat, 31 Jul 2010 18:26:00 -0500 (Local time: Sun, 1 Aug 2010 09:26:00 +1000)

-rw-r--r-- 1 troz troz 2061 Jul 31 18:26 /home/troz/troz.net/onrev/samples/touch.irev

This has an interesting side-effect:
When I upload a file, I usually get a file date without a time e.g. Sep 14 2009
After using the 'touch' command, I get a proper date & time e.g. Sep 13 23:52
Allowing for time zones, it is currently 14:52 on Sep 14 for me, and 23:52 Sep 13 at the server.

Include files:

includes/moddate.irev