Thursday, March 20, 2008

Use Time Stamp to Create Files or Folder Using Ant

Every now and then we come across a situation where we are in a need of creating folder with the name of time stamp so that we can keep record of every execution, don't we ;-) ?
Its fairly easy to accomplish this in Ant
use tstamp task.
This is how a set a property "START_TIME" and use it to create that file/folder.
<tstamp>
<format property="START_TIME" pattern="dd_MMM_yy_HH_mm_ss"/>
</tstamp>

Like
<property name="testresults-folder" value="${START_TIME}_TestResults"/>
and create a folder by this property
<mkdir dir="${testresults-folder}"/>

1 comments:

Câmera Digital said...

Hello. This post is likeable, and your blog is very interesting, congratulations :-). I will add in my blogroll =). If possible gives a last there on my blog, it is about the Câmera Digital, I hope you enjoy. The address is http://camera-fotografica-digital.blogspot.com. A hug.

Post a Comment