in reply to Log's and MD5 Hashes

so, effectively you want to see if one file has a different hash to another file?

you go thru' the list of files, create the hash and store it against the filename.

the next pass, you go get the filename and the hash, then using the retrieved filename generate another hash into a different variable, then compare the old and new hashes...

If your script is a deamon, use a config file to store the files you want to hash, and an $oldhash and $newhash variable to compare any difference between the two values. Make sure you suck in the config file over every iteration so you can pick up any addition/deletions rather than restarting the daemon each time.

that sounds way too simple an answer, perhaps i dont understand your question properly

Replies are listed 'Best First'.
Re: Re: Log's and MD5 Hashes
by satanklawz (Beadle) on Jan 31, 2002 at 03:52 UTC
    This is what I want it to do.... Report to me what files have changed due to different MD5 hashes, and report to me which files have changed. I probably don't understand your reply enough, mind some sudo (sp) code? I'm terribly sorry if I am being dense, probably the weather. Russ
      Okay- I just realized a better phrasing....
      What I am having an issue with is getting the hashes to match up with a file. You can see that in the code I have sofar it opens up the config and runs a hash against all of the lines in the file, then it stores the hashes into a file. The problem lies here for me:

      if ($NEW-HASH-RUN <> $OLD-HASH-RUN) {
      print "The system file: $file is different.";
      }
        You probably want 'ne' rather than '<>' as your MD5 hash isn't just numbers...

        gav^