Just looking at this post to the nant-users list...
Would it be useful in general to be able to specify a file to redirect into standard input for an external program? It would be pretty trivial to add an <input> element to ExternalProgramBase which could specify a source file to pipe through to standard input.
Or is this just patching symptoms, and dancing around the real feature (That I think I saw mentioned in the archives) of implementing pipes? If fork/join was added to ExternalProgramBase, then exec becomes composable:
<pipe file="input.txt" id="input" />
<exec program="munge" fork="true" pid="munge.pid">
<input pipe="input" />
<output pipe="munge.output" log="false" />
<error log="true" />
</exec>
<property name="grep-tool" value="grep" if="${platform::is-unix()}" />
<property name="grep-tool" value="find" if="${platform::is-win32()}" />
<property name="grep-args" value="-i '${filter}'" if="${platform::is-unix()}" />
<property name="grep-args" value="/i "${filter}"" if="${platform::is-win32()}" />
<exec program="${grep-tool}" commandline="${grep-args}">
<input pipe="munge.output" log="false" />
<output file="output.txt" />
<error log="true" />
</exec>
<!-- join is optional, since the 'find' program should terminate when its input pipe closes, so munge has already completed
<join>
<pid value="${munge.pid}" />
</join>
-->
*Sample language, I'm sure it could be improved.
-------- Original Message -------- Subject: RE: [Nant-users] chmod a+x equivalent in nant? Date: Thu, 12 Aug 2004 11:48:04 +0300 From: Hristo Deshev | telerik <[EMAIL PROTECTED]> Reply-To: <[EMAIL PROTECTED]> Organization: telerik To: <[EMAIL PROTECTED]>
Hi Jeroen,
I am <exec>'ing the cacls.exe utility to change the permissions in a build target. Here's an example:
<exec program="cmd.exe" workingdir="."> <arg value="/c cacls" /> <arg value="${mdb.file}" /> <arg value="/E" /> <arg value="/G testpc\aspnet:F" /> <arg value="< y.txt" /> </exec>
Note the input redirection --> "< y.txt". Cacls asks a dumb "are you sure" question at the console, and the y.txt file contains just a "y" and a new line symbol.
Hope this helps.
Hristo Deshev
------------------------------------------------------- SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift. http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285 _______________________________________________ nant-developers mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/nant-developers