Return-Path: Mailing-List: contact ant-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list ant-user@jakarta.apache.org Received: (qmail 5070 invoked from network); 12 Nov 2000 03:15:01 -0000 Received: from web115.mail.yahoo.com (HELO web115.yahoomail.com) (205.180.60.88) by locus.apache.org with SMTP; 12 Nov 2000 03:15:01 -0000 Received: (qmail 14273 invoked by uid 60001); 12 Nov 2000 03:15:02 -0000 Message-ID: <20001112031502.14272.qmail@web115.yahoomail.com> Received: from [64.163.67.114] by web115.yahoomail.com; Sat, 11 Nov 2000 19:15:02 PST Date: Sat, 11 Nov 2000 19:15:02 -0800 (PST) From: Diane Holt Subject: Re: Checking for file/directory existence To: ant-user@jakarta.apache.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N --- Artem Portnoy wrote: > Is it possible in Ant to execute a task depending on the file or > directory existence? There's the task: http://jakarta.apache.org/ant/jakarta-ant/docs/#available but I don't think you can specify a directory instead of a file. But note: You can only do execution-determination with the if/unless at the target level, not at the task level. > For example, I would like to copy a certain file if it exists or skip > the copy operation if it doesn't. How do I do that? Well, copy will tell you the file doesn't exist (post 1.2), but it won't cause the build to fail just because of that. So it shouldn't actually hurt anything if the executes even if the file doesn't exist. Diane ===== (holtdl@yahoo.com) __________________________________________________ Do You Yahoo!? Yahoo! Calendar - Get organized for the holidays! http://calendar.yahoo.com/