I don't think you'll be able to do this as that's not how the FileSet works. The FileSet enumerates the files that match one or more patterns. When you specify a fileset as you have done below, you are not actually adding Project1.csproj to the FileSet, you are adding the pattern. This pattern may match either 0 or 1 files on the disk. Therefore you can never say that a FileSet definition contains a specified number of files, only that applying that pattern to a physical location matches a specified number of files. HTH, Bill As a foot note, why would you want to include files in a FileSet that don't exist?
-----Original Message----- From: netvampire.tw [mailto:netvampire...@yahoo.com.tw] Sent: 25 March 2009 08:56 To: nant-users@lists.sourceforge.net Subject: [NAnt-users] fileset Function only work when file exists ? Dear all: I have problem use fileset::get-file-count Function.I had lots of fileset to verify if file exists. I use below example to echo message.It only list that file exists... and if I use fileset::get-file-count Function it counts only if physical disk exists file. how could I list fileset exists but physical disk not exists? <project name="foreach.example" default="build" basedir="."> <fileset id="projects"> <include name="C:\temp\Project1.csproj" /> <include name="C:\temp\Project2.csproj" /> </fileset> <target name="build" > <foreach item="File" property="vsnet.project"> <in> <items refid="projects" /> </in> <do> <echo message="${vsnet.project}"/> </do> </foreach> ..... Thanks a lot ______________________________________________________________________________________________________ 付費才容量無上限?Yahoo!奇摩電子信箱2.0免費給你,信件永遠不必刪! http://tw.mg0.mail.yahoo.com/dc/landing ------------------------------------------------------------------------------ Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are powering Web 2.0 with engaging, cross-platform capabilities. Quickly and easily build your RIAs with Flex Builder, the Eclipse(TM)based development software that enables intelligent coding and step-through debugging. Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com _______________________________________________ NAnt-users mailing list NAnt-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nant-users ______________________________________________________________________ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email ______________________________________________________________________ IMPORTANT The information contained in this e-mail and any attachments is intended for the addressee only and may contain legally privileged or confidential information. If you are not the intended recipient you must not use, disclose, copy, distribute, alter, or take any action in reliance on the information and Avon Insurance plc will not accept liability for any loss or damage howsoever arising, directly or indirectly in reliance on it and gives no warranty or representation as to its accuracy or reliability. If you are not the addressee, please notify us immediately on 01789 202121* and delete the material from your computer and destroy any copies. Avon Insurance plc reserves the right to monitor and record incoming and outgoing email messages for the purposes of investigating or detecting unauthorised use of its system and ensuring its effective operation. Avon Insurance plc will not accept liability for any loss or damage as a result of any virus being passed on. Avon Insurance plc (No. 209606). Registered in England. Registered Office: Tiddington Road, Stratford-upon-Avon, Warwickshire CV37 7BJ. Authorised and regulated by the Financial Services Authority. A member of the NFU Mutual group of companies and the Association of British Insurers. For security and training purposes telephone calls may be recorded and monitored. ______________________________________________________________________ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email ______________________________________________________________________ ------------------------------------------------------------------------------ Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are powering Web 2.0 with engaging, cross-platform capabilities. Quickly and easily build your RIAs with Flex Builder, the Eclipse(TM)based development software that enables intelligent coding and step-through debugging. Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com _______________________________________________ NAnt-users mailing list NAnt-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nant-users