Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 16143 invoked from network); 26 May 2008 15:00:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 26 May 2008 15:00:38 -0000 Received: (qmail 50321 invoked by uid 500); 26 May 2008 15:00:34 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 50299 invoked by uid 500); 26 May 2008 15:00:34 -0000 Mailing-List: contact user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list user@ant.apache.org Received: (qmail 50288 invoked by uid 99); 26 May 2008 15:00:34 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 May 2008 08:00:34 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of qazwart@gmail.com designates 209.85.128.189 as permitted sender) Received: from [209.85.128.189] (HELO fk-out-0910.google.com) (209.85.128.189) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 May 2008 14:59:44 +0000 Received: by fk-out-0910.google.com with SMTP id 19so2018619fkr.12 for ; Mon, 26 May 2008 08:00:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=G8M2gaLDrGD7QWmelFkDzmInfw/jkPmDTtsNuQ/W1Ug=; b=HL6yimNQkNNuLKUWkCmESNUsmdI70UoA8Pw8+I/QaOyf13SmptUgGDcgsHLsZ3YPg2XJDflVTwCTixqOeCJyCOA3BNXZI85W/xqqdEvyY2iJ+p1Gub62SFQVOvTV0F5IN3Tb8std2e5SUAubPS50/k/krTOwBPLqexlySchZkiU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=Te6c8nUbNLUbQZDkotjtNqj+ZQ5fqRoNh4VLJcRtKZHQp4VXnUZIHqEZGIe+3W8xAxin/d7m69wMcxQwkWEX/oVbu6wOOqb1G9mqOVabBSktHfYqjD7KxRQ2dms4DnqacgosrKRNGSc0y4y7YWsjQ5GlGWSIcZQsseWmoTfhswc= Received: by 10.82.107.3 with SMTP id f3mr163576buc.87.1211813999503; Mon, 26 May 2008 07:59:59 -0700 (PDT) Received: by 10.82.176.9 with HTTP; Mon, 26 May 2008 07:59:59 -0700 (PDT) Message-ID: Date: Mon, 26 May 2008 09:59:59 -0500 From: "David Weintraub" To: "Ant Users List" Subject: Re: Possible Bug? Ant task does not handle files with over 255 chars in the path name In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: X-Virus-Checked: Checked by ClamAV on apache.org This is really a limit on the Windows system itself and not Java or Ant. Although in theory it is possible to have longer file names in Windows, the cutoff in real life is about 255 characters. This includes the directories, the directory separators, and the drive letter and colon. This has to do with the older Windows library function in order to open a file. There is a newer call in order to do this, and that could allow you to use a file name up to 25K. However, Windows itself uses the older style function. Try an experiment: * Open Windows Explorer, and create a directory called "C:\abcdefghijklmnopqrstuvwx\abcdefghijklmnopqrstuvwx\abcdefghijklmnopqrstuvwx\abcdefghijklmnopqrstuvwx\abcdefghijklmnopqrstuvwx\\abcdefghijklmnopqrstuvwx" That's a path of 152 characters in its name. * Open a DOS command and execute the following command: subst Q: C:\abcdefghijklmnopqrstuvwx\abcdefghijklmnopqrstuvwx\abcdefghijklmnopqrstuvwx\abcdefghijklmnopqrstuvwx\abcdefghijklmnopqrstuvwx\abcdefghijklmnopqrstuvwx This will create a drive called "Q:" that has as its root the directory you just created. * Now create a directory called "Q:\abcdefghijklmnopqrstuvwx\abcdefghijklmnopqrstuvwx\abcdefghijklmnopqrstuvwx\abcdefghijklmnopqrstuvwx\abcdefghijklmnopqrstuvwx\\abcdefghijklmnopqrstuvwx" in Windows Explorer. Again, that has 152 characters in its directory name. * Create a text file called "FOO.txt" in that directory on drive Q: * From your C:\ drive, try to access that file FOO.txt using Windows Explorer. You will get an error that the directory name is illegal. Windows is unable to access the file because the name from the root of the drive is longer than 255 characters. * To get rid of the file. Delete it from the Q: drive and then delete the directory from the Q: drive. Then run "subst q: /d" to remove the Q: drive. After that, you can remove the rest of the directory via the C: drive. On Fri, May 23, 2008 at 9:08 AM, Adrian Muscalu wrote: > > Hello, > > I am running an ANT script on my Win XP machine; one of the tasks attempts to create a jar file where the class files are in a directory with a long name. The combined path, package name and file name exceedes 255 characters. > > Expected result: > The script should fail as the files exceed the Windows XP file system limitation. > > Actual result: > The build finishes with a successfull state although the files that have the long name in the soturce directory have not been included into the jar. > > I was hoping for ANT to report on the problem and stop the build; Ant managed to create the long named files just fine, but any subsequent operation on them (copy, jar) fails without notification. Any attempt to work with the files on the Windows DOS prompt (copy command) ends with a pertinent message saying that the file name is too long and the operation fails. > > Is this a bug? I don't expect ANT to fix the XP limitation, just to report on it somehow. > > Thank you, > Adrian > _________________________________________________________________ > News, entertainment and everything you care about at Live.com. Get it now! > http://www.live.com/getstarted.aspx -- -- David Weintraub qazwart@gmail.com --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org