[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

File Modification Monitor

Travis Gassmann

12/14/2007 11:06:00 PM

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
--
Posted via http://www.ruby-....

1 Answer

Andrew Stewart

12/17/2007 2:32:00 PM

0


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.

http://www.zenspider.com/ZSS/Product...

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

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

Regards,
Andy Stewart


-------
http://airbladeso...