Solved

File Validation Checks with ANT

Posted on 2006-06-25
3
245 Views
Last Modified: 2010-05-18
Hey,

I'm trying to test for empty files - ie files of 0 k size, and also trying to test for certain characters in a filename -  ie pattern matching.

I understand that ANT isn't really intended for these kind of tasks - but I'm hoping that there might be a way,


thanks
0
Comment
Question by:RichardStarkey
3 Comments
 
LVL 15

Accepted Solution

by:
bpmurray earned 250 total points
ID: 16982953
You can use fileset. For example, to include all the files that have the extension ".txt" and to exclude those that start with an "X" (but not "x") and that have a size greator than zero ...

<fileset dir="/foo/bar">
  <patternset>
      <include name="**/*.txt" />
      <exclude name="**/X*.*" />
  </patternset>
  <size value="0" units="K" when="equal"/>
</fileset>
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question