Home  |  Linux  | Mysql  | PHP  | XML
From:ben perl Date:Tue Mar 16 19:18:44 2010
Subject:running stats on a file
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:

[admin@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

Navigate in group perl.beginners at sever nntp.perl.org
Previous Next


Your recent visits
Re: Any Good SCM tool to manage Perl Code locally
Re: 1-line text file with numbers, need to add to them
Re: 1-line datafile, need data for another routine
Re: complex subroutine arguments
Re: module installation



  
© No Copyright
You are free to use Anything, but please consult your advocate before doing so as this website
also list content from other sources which may be copyrighted.
Site Maintained by Zareef Ahmed
Powered By PHP Consultants