0

次のスクリプトを使用して、フォルダーのファイル名を取得しようとしました

   <target name="test1" depends ="init">
       <fileset id="appendJars" dir="${ant.dir}/test">
        <include name="*.txt" />
    </fileset>
    <pathconvert property="files" refid="appendJars" pathsep="," />

    <echo message="files: ${files}"  />
    <for list="${files}" param="f">

        <sequential>
        <echo>@{f}</echo>
            <antcall target="test2">
            <param name="fileName"  value="@{f}" />
            </antcall>
        </sequential>
        </for>  
</target>

ファイル名を E:/ant/test/1.txt として取得します ... 1.txt を取得したいのですが、どうすればよいですか?

4

1 に答える 1

1

<basename/>task を使用してファイル名を取得できます。詳細については、こちらをご覧ください

于 2013-03-21T12:15:12.867 に答える