Return-Path: Delivered-To: apmail-jakarta-ant-dev-archive@jakarta.apache.org Received: (qmail 26077 invoked by uid 500); 12 Sep 2001 00:14:05 -0000 Mailing-List: contact ant-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk Reply-To: ant-dev@jakarta.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list ant-dev@jakarta.apache.org Received: (qmail 26068 invoked from network); 12 Sep 2001 00:14:04 -0000 Message-ID: <3B9EA8BE.D2109943@sun.com> Date: Tue, 11 Sep 2001 17:13:50 -0700 From: Alejandro Abdelnur Organization: Sun Microsystems, Inc. X-Mailer: Mozilla 4.76 [en]C-AOLNSCP (WinNT; U) X-Accept-Language: en-US,en,es-AR,fr-FR MIME-Version: 1.0 To: ant-dev@jakarta.apache.org Subject: Re: Ant and FileSystem References: <09003632.351DDC6B.02250412@netscape.net> <3B952F25.97EE6D0A@sun.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N stefan, what you say makes sense, now based on your description on how things work, shouldn't the Ant.setAntfile(String) method be changed to Ant.setAntfile(File) ? thxs. a Stefan Bodewig wrote: > On Tue, 04 Sep 2001, Alejandro Abdelnur > wrote: > > > i've run into a similar problem in the ant's antfile, the problem > > appears to be a bug in the java.io.File.isAbsolute() method in the > > windows platform. > > Judging from your patch I assume that you think File.isAbsolute() > should return true for \temp on Windows, right? > > From the javadocs of File: > > >> An absolute pathname is complete in that no other information is > >> required in order to locate the file that it denotes. > > with this definition, I think you are wrong. > > A completely different issue is whether FileUtils.normalize() should > treat \temp the same way it treats an absolute path (it does) - I'm > not sure as I cannot really see all consequences here. > > In which situation would a Windows user (I'm not part of that > community, so I don't really know) use \temp instead of C:\temp? > > > i think the place to add this workaround is the > > FileUtils.normalize() method, > > I think it already treats paths starting with File.separator as > absolute paths. Looks as if should use > FileUtils.resolveFile(dir, antfile) in its execute method. > > > then the ant.setAntfile() method should be retrofitted to use the > > normalized (similarly any other attribute that expects a file name). > > Most tasks have setters that expect a File argument when they expect > filenames - these setters will receive File instances that went > through FileUtils.normalize (via FileUtils.resolveFile) automatically. > > Stefan