ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicolas Vervelle <nicolas.verve...@steria.com>
Subject Comparing two files
Date Fri, 02 Sep 2005 17:03:53 GMT
Hi,

there's probably a simple way to do it, but I don't know how.

I want to compare two files (see if they have the same contents, 
timestamp can be different) and then if they differ I want to copy an 
other file.
Can someone help me ?

Thanks in advance,
Nicolas


PS: If you need more infos, here's the context and what I need to do.
I have a .pot file that is created by an external tool (xgettext), but 
I want to replace my existing .pot file only if the difference between 
the old and the new file is significative enough (if only comments 
differ, I want to keep the old file)
So, for the moment, I do the following :
- copy the old file to tmp/old.pot with <copy>
- remove non important things in tmp/old.pot with <replaceregexp>
- generate the new .pot file in tmp/my.pot with xgettext
- copy the new file to tmp/new.pot with <copy>
- remove non important things in tmp/new.pot with <replaceregexp>
The last part for which I am asking help: if tmp/old.pot differs from 
tmp/new.pot then replace my.pot with tmp/my.pot


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message