Solved

File Validation Checks with ANT

Posted on 2006-06-25
3
237 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
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…

708 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now