Newer versions of ant-contrib do support unset...  :)

Benjamin H. wrote:
The <var> type doesn't support the "unset" attribute.

I think the problem is using ant-contrib in a old version (0.6) .....



2006/8/17, Scot P. Floess <[EMAIL PROTECTED]>:

Try this:

<target name="start">
       <fileset dir="referenz" id="filename"/>
       <for param="file">
           <path>
               <fileset refid="filename" />
           </path>
           <sequential>
               <var name="filename" unset = "true"/>
               <basename property="filename" file="@{file}" />
               <echo>Filename === ${filename}</echo>
           </sequential>
       </for>
   </target>

Notice the <var> element has the attribute unset="true"

Benjamin H. wrote:
> I has try this:
> <target name="start">
>        <fileset dir="referenz" id="filename"/>
>        <for param="file">
>            <path>
>                <fileset refid="filename" />
>            </path>
>            <sequential>
>                <var name="filename" />
>                <basename property="filename" file="@{file}" />
>                <echo>Filename === ${filename}</echo>
>            </sequential>
>        </for>
>
>    </target>
>
> But not so successful!!
>
>
> 2006/8/17, Scot P. Floess <[EMAIL PROTECTED]>:
>>
>> Did you try the <basename> task?
>>
>> Benjamin H. wrote:
>> > Hi out there,
>> >
>> > is it possible to get only the name of a file without the whole
path??
>> >
>> > This is for path - but only need the filename:
>> > <for param="filename">
>> >            <path>
>> >                <fileset dir="reftest" />
>> >            </path>
>> >                <sequential><echo>@{filename}</echo></sequential>
>> >                </for>
>> >
>> > The files are in a directory!!
>> >
>> > Regards ele
>> >
>>
>> --
>> Scot P. Floess
>> 27 Lake Royale
>> Louisburg, NC  27549
>>
>> 252-478-8087 (Home)
>> 919-754-4592 (Work)
>>
>> Chief Architect JPlate  http://sourceforge.net/projects/jplate
>> Chief Architect JavaPIM http://sourceforge.net/projects/javapim
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>

--
Scot P. Floess
27 Lake Royale
Louisburg, NC  27549

252-478-8087 (Home)
919-754-4592 (Work)

Chief Architect JPlate  http://sourceforge.net/projects/jplate
Chief Architect JavaPIM http://sourceforge.net/projects/javapim


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




--
Scot P. Floess
27 Lake Royale
Louisburg, NC  27549

252-478-8087 (Home)
919-754-4592 (Work)

Chief Architect JPlate  http://sourceforge.net/projects/jplate
Chief Architect JavaPIM http://sourceforge.net/projects/javapim


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

Reply via email to