Hi,
first, thanks for your help!!

I tried to implement the pfunctions - lib.. but not so successful..

I think the solution with ant-contrib and the 'for' - iteration is good...

But following problem embarrass me...

BUILD FAILED
C:\workspace\Synchro - Tool\Ant - Tests\build.xml:24: The <var> type doesn't
support the "unset" attribute.

this is the code:
<target name="default" description="--> description">
                <echo>"TEST"</echo>

                <property name="x" value="6"/>
                    <echo>${x}</echo>   <!-- will print 6 -->
                    <var name="x" unset="true"/>
                    <property name="x" value="12"/>
                    <echo>${x}</echo>   <!-- will print 12 -->

                 </target>

same problem was in Gilbert's script??
What's the problem?

In the official doc for ant-contrib is the task also included.... ?!?!

I've version 0.6 in use - and Ant 1.6.5...





Zitat von "Rebhan, Gilbert" <[EMAIL PROTECTED]>:


Second suggestion =

i think your problem is, that properties are immutable once set

here's a workaround with <var> from antcontrib :

<fileset id="files" dir="T:/foobar" includes="*.*" />


<for param="file">
<path>
        <fileset refid="files" />
</path>
<sequential>
<echo>
Filepath === @{file}
 </echo>

<var name="filename" unset="true" />
<basename property="filename" file="@{file}" />

<echo>
Filename === ${filename}
</echo>

</sequential>
</for>


the property file is automatically overwritten for every loop, but
the property filename has to be unset and set again

i think you have to do the same for
$hostname} and  ${num} in your script.


Regards, Gilbert

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Monday, July 31, 2006 11:06 AM
To: [email protected]
Subject: properties handling problem

Hi,
this is Code for deliver files to different systems with a pre-check...

I'll iterate with der foreach-Task.

The Problem is, I don't now how to set the properties.

Properties
available=availability
availabledir=/export/home/heisc01/anttest/
output=output
hostlist=host_1,host_2,host_3
hostname=host

I think like this: server="${$hostname}_${num}}"
but it didn't work..

Could somebody help me..

best regards..
Beni


<!-- =================================
                     target: Schleife für Verfügbarkeitstest
                    ================================= -->
       <target name="availableloop">
                               <foreach list="1,2,3,4" target="availability"
param="num" />
               </target>

       <!-- =================================
                 target: Verfügbarkeitstest der Systeme als Voraussetzung für
upload
                ================================= -->
       <target name="availability" description="Checking the systems for
availability">
               <echo message="Verfügbarkeitscheck Nr  ${num}"/>
               <delete file="${available}/*.available"/>
               <ftp action="get" password="${password}"
server="${$hostname}_${num}}"
userid="${username}" remotedir="${availabledir}">
                       <fileset dir="${available}">
                               <include name="*.available" />
                       </fileset>
               </ftp>
               <available
file="${available}/"${$hostname}_${num}}".available"
property=""${$hostname}_${num}}".ready"/>
               <antcall target="upload"></antcall>
       </target>


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


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






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

Reply via email to