假设我有一个目录,其中包含几个具有相同名称前缀和时间戳的文件,例如
my-directory:
- file-0749
- file-1253
- file-2304
Run Code Online (Sandbox Code Playgroud)
如何告诉ANT从我的目录中选择最新修改的文件(在这种情况下,这将是文件-2304)?
les*_*ana 17
您可以使用ant-contrib中的TimestampSelector任务执行此操作.
<timestampselector property="latest.modified">
<path>
<fileset dir="${my-directory.dir}">
<include name="file-*" />
</fileset>
</path>
</timestampselector>
<echo message="${latest.modified}" />
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6319 次 |
| 最近记录: |