detecting a file is updated.

detecting a file is updated.

Post by Joe Won » Tue, 01 Aug 2000 04:00:00



Hi,

  If there any system call that can tell me a file has been modified? I
tried to save the last modified time of a file but the time resolution is up
to second only, which is not good enough to use for very fast computer..

TIA

- Joe

 
 
 

detecting a file is updated.

Post by Remco Wout » Wed, 02 Aug 2000 04:00:00



> Hi,

>   If there any system call that can tell me a file has been modified? I
> tried to save the last modified time of a file but the time resolution is up
> to second only, which is not good enough to use for very fast computer..

You want to write a small program using a select(2) loop.
--
remco

 
 
 

1. Detecting a new or updated file

I have a script that checks a list of user home directories for a
particular file (public_html/index.html) being newer than a time stamp
file's date.

These are the relavant commands:

  NEW=`find $HOMEDIR/public_html -name index.html -newer $STAMP -print`
  if [ "$NEW" ]; then
    ...
  fi

Problem is, the find command is wandering off into subdirectories, and
sometimes gets its fingers rapped when permissions deny access, like
this:

  find: cannot chdir to /home/theo/public_html/toprint: Permission denied

I would like to avoid the unwanted wanderings of find, and the error
messages.

Is there a way to perform the time stamp comparison, either by
restricting find (I have tried other find options, but no success),
or another tool?

I would rather not use perl, as it would require my installing it on
a number of machines at different sites.

Thanks for any help.

Glenn

2. Window Managers

3. how to detect if i am behind a NAT?

4. Use of "eval" in creating new variable names

5. Boot disk does not detect IDE Toshiba CD-ROM or am I stupid?

6. Sun to route IPX packets?

7. Is there an update command for updated aliases file?

8. Apache to Modem connection

9. I am looking for a way to update passwords via program or script

10. Is there a way to hide files/directories and detect file access\?

11. Detect new files/file changes without polling?

12. Is there a way to hide files/directories and detect file access\?

13. make - detecting updating of targets