Mike,

 

This seems more like a candidate for a function.

 

For example:

 

<property value="md5.value" value="${file::get-checksum('abc.dat','md5')}"
/>

 

Gert

 

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Mike Frederick
Sent: maandag 11 augustus 2008 22:15
To: nantcontrib-developer@lists.sourceforge.net
Subject: [NAntC-Dev] The checksum task

 

Hello,

I am developing a rather complex set of web server deployment scripts and
one of the tasks that has been assigned to me is to maintain some sort of
checksums of the files that are deployed so that at any time I can verify
that deployed files are exactly as they were when they were deployed.  I was
relieved to find the NAntContrib checksum task.

However, I *really* don't like the way that it does its work.  This task
requires write access to the folder in which the files to be checksummed
reside.  The task writes the checksum values into small text files "next to"
the file to be checksummed.  This is kind of kludgy; it is also undesirable
when you are doing checksums of files that are in production web folders.
When I am perfoming this operation I want READ-ONLY access to all of the
files.

Well, I'm not a C# guy, but I have managed to throw something together that
simplifies the checksum task and returns the checksum value in a NAnt
property (which is what I was going to eventually need anyway!).  I didn't
modify the checksum task; I just created a new one named checksum1.

I know I have missed a bunch of stuff, but is this worth giving to someone
as a submission?  Usage looks like:


<checksum1 file="abc.dat" algorithm="md5" property="md5.value"/>


and you end up with the md5 checksum of the file abc.dat in the property
md5.value. 

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
NAntContrib-Developer mailing list
NAntContrib-Developer@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nantcontrib-developer

Reply via email to