File Modification Monitor

Hello,

I am new to ruby. I have a thrid party application that stores
configuration settings in an ASCII/TEXT file. I need to map each
function within the application to what lines it modifies in the text
file. Every time I save the session, it creates a *.bak_YYMMDDHHmmss of
the previous version of the file.

I am looking to develop a simple script that I would loop through a
directory and then compare the oldest *.bak_YYMMDDHHmmss with the next
newest *.bak_YYMMDDHHmmss, until it reached the newest file. The script
would append the differences to a text file.

A nice to have is a start and stop funcation, where I could have it
watch a directory and when ever a new *.bak_YYMMDDHHmmss file appears it
will compare the files.

I am looking for resoucres on how to program this script.

Thanks
jlimited

On 14 Dec 2007, at 23:06, Travis Gassmann wrote:

A nice to have is a start and stop funcation, where I could have it
watch a directory and when ever a new *.bak_YYMMDDHHmmss file
appears it
will compare the files.

I am looking for resoucres on how to program this script.

You might Autotest’s code instructive. It watches a directory (of
test files) and triggers whenever it spots a change.

For file comparison diff-lcs should be more than enough:

http://raa.ruby-lang.org/project/diff-lcs/

Regards,
Andy S.