Hi Everyone,

I writing this program to check if a file is being touched (linux "touch"
command) every 25   seconds.I am using stat command on linux.

For example(please check the bold),

stat file
  File: `file'
  Size: 0               Blocks: 0          IO Block: 4096   regular empty
file
Device: 803h/2051d      Inode: 164394      Links: 1
Access: (0666/-rw-rw-rw-)  Uid: (    0/   admin)   Gid: (    0/    root)
Access: 2010-03-16 12:09:03.000000000 -0700
Modify: 2010-03-16 12:09:03.000000000 -0700
Change: *2010-03-16 *12:09:03.000000000 -0700              <=


After 25 seconds:

[ad...@machine ~]# stat file
  File: `file'
  Size: 0               Blocks: 0          IO Block: 4096   regular empty
file
Device: 803h/2051d      Inode: 164394      Links: 1
Access: (0666/-rw-rw-rw-)  Uid: (    0/   admin)   Gid: (    0/    root)
Access: 2010-03-16 12:09:28.000000000 -0700
Modify: 2010-03-16 12:09:28.000000000 -0700
Change: *2010-03-16* 12:09:28.000000000 -0700             <=


I am just worried about the change attribute above from stat command. So ,
what i am trying to do convert 12:09:03(as in the example above)  into
seconds and add 25 seconds and convert back into "hour:minutes:seconds"
format and check the values match.

Hope it is clear.

Thanks for the help in advance,
-Ben

Reply via email to