----- Original Message -----
From: "Rob van Oostrum" <[EMAIL PROTECTED]>
To: "Ant Developers List" <[EMAIL PROTECTED]>
Sent: Tuesday, September 10, 2002 00:43
Subject: Re: Bug 3129 - <which> task proposal


> Sounds like what you're really looking for is an Ant-version of the which
> command.
>
> Something like <which basedir="." file="ssh.eze" property="ssh.exe" />
where
> basedir is optional and represents the directory from which to run
'which'.
>
> Should be easy enough for Linux/Unix. Not sure how I would prefer to do
this
> on Win32 though. For users with the cygwin bin directory in their paths
the
> task could use cygwin which (check with <available file="which" ...). If
> this doesn't fly, the task should probably append the filename to each
path
> element and run an <available> until it finds a match or runs out of path
> elements . Anybody working on this yet? Any suggestions?

Available does search for a file on a path; this code could be used as the
basis for <which>.

>
>
> cheers
> Rob
>
> ----- Original Message -----
> From: "Stefan Bodewig" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, September 10, 2002 8:18 AM
> Subject: Re: Bug 3129
>
>
> > On Mon, 9 Sep 2002, Dominique Devienne <[EMAIL PROTECTED]> wrote:
> >
> > > You can get the absolute pathname of your executable on Win32 using:
> > >
> > > <available property="ssh.exe" file="ssh.exe" filepath="${env.Path}"
> > > />
> > >
> > > and use ${ssh.exe} thereafter.
> >
> > Are you sure?
> >
> > I'd think this property would be either unset or "true" after that
> > task.  Yep:
> >
> > [EMAIL PROTECTED] bodewig]$ cat > /tmp/ssh.xml
> > <project default="foo">
> >   <target name="foo">
> >     <property environment="env"/>
> >     <available property="ssh" file="ssh" filepath="${env.PATH}"/>
> >     <echo>${ssh}</echo>
> >   </target>
> > </project>
> > [EMAIL PROTECTED] bodewig]$ ant -f /tmp/ssh.xml -verbose
> > Apache Ant version 1.6alpha compiled on September 9 2002
> > Buildfile: /tmp/ssh.xml
> > ...
> > foo:
> >  [property] Loading Environment env.
> > [available] Found: ssh in /usr/bin
> >      [echo] true
> >
> > BUILD SUCCESSFUL
> > Total time: 3 seconds
> >
> > Stefan
> >
> > --
> > To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
> >
> >
>
>
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to