[plug] Scripting for email

Jason Nicholls jason at mindsocket.com.au
Sat Aug 12 21:54:58 WST 2000


Hiya,

On Sat, Aug 12, 2000 at 09:03:02PM +0800, Leon Brooks wrote:
> Jason Nicholls wrote:
> > Looking at the last modified time isn't going to help because it
> > will be updated every time mail is *received*. You need to look
> > at the access time.
> 
> Almost certainly game over player 2, as the access time would track the
> mod time. I suspect I would be "tail -f"ing the mail log from inittab
> and touching my own status files as appropriate.

I haven't looked, but I doubt the "finger" utilty works this way, and it is
somehow able to work out how long it's been since picking up mail.

I just did a little test. It involved a file last modified on the 23rd July. I
echoed something into the file and checked the modified time (yup updated) but
the access time didn't change. Here is some captured output:


[jason at nikita Nik-Fish] ls -al *.txt
-rw-r-----   1 jason    jason           0 Jun 23 11:33 phuture-sonic.txt
[jason at nikita Nik-Fish] echo "hi" > phuture-sonic.txt 
[jason at nikita Nik-Fish] find -mmin -10
./phuture-sonic.txt
[jason at nikita Nik-Fish] find -amin -10
.
[jason at nikita Nik-Fish] 

I'm not trying to dispute anything, but would like to know what the situation
is. If a file is opened for appending (O_APPEND) the access time is probably
not modified. Since a MTA would most likely append to the mailbox wouldn't
this be the case?

Oops, just realised the above as a overwrite (not append, ">>") and re-did the 
test which worked.

Further, a simple "cat phuture-sonic.txt" did affect the access time:

[jason at nikita Nik-Fish] cat phuture-sonic.txt 
hi
[jason at nikita Nik-Fish] find -amin -10
.
./phuture-sonic.txt
[jason at nikita Nik-Fish] 



Later,

Jason Nicholls
--------------------------------------------------------------------
Jason Nicholls    icq: 11745841    email: <jason at mindsocket.com.au>
Proprietor                        mobile: 0417 410 811
Mind Socket [web services]          http://www.mindsocket.com.au/
--------------------------------------------------------------------



More information about the plug mailing list