Return-Path: Mailing-List: contact user-help@ant.apache.org; run by ezmlm Delivered-To: mailing list user@ant.apache.org Received: (qmail 55630 invoked from network); 3 Apr 2003 05:40:37 -0000 Received: from amadeus.ifi.unizh.ch (HELO mail.ifi.unizh.ch) (130.60.48.21) by daedalus.apache.org with SMTP; 3 Apr 2003 05:40:37 -0000 Received: (qmail 8601 invoked from network); 3 Apr 2003 05:40:45 -0000 X-Remote-IP: 212.254.96.178 Received: from adsl-96-178-zh1.tiscali.ch (HELO ifi.unizh.ch) (212.254.96.178) by amadeus.ifi.unizh.ch with SMTP; 3 Apr 2003 05:40:45 -0000 Date: Thu, 3 Apr 2003 07:40:44 +0200 Subject: Re: filter: Windows backslashes in a properties file Content-Type: text/plain; charset=US-ASCII; format=flowed Mime-Version: 1.0 (Apple Message framework v551) From: Denis N. Antonioli To: "Ant Users List" Content-Transfer-Encoding: 7bit In-Reply-To: Message-Id: X-Mailer: Apple Mail (2.551) X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N On Jeudi, avr 3, 2003, at 05:55 Europe/Zurich, John Lindwall wrote: > My build.xml is copying a properties file and using a filterset to > perform substitutions during the copy. > > todir="${build.test.dir}" filtering="yes"> > > > > > > On our Windows development machines ${basedir} is generally "D:\Lor". > The resulting file is properly substituted such that any occurrence > of "@LOR_HOME@" is replaced with "D:\Lor". > > The output file is a properties file and when we load the properties > at runtime this string is transformed to "D:Lor" -- note the missing > backslash. The resulting path is no good since it lacks that initial > backslash. > > Is there some way to handle this issue nicely? There are two solutions: 1) '\' is an escape character, so write it twice, as: "D:\\Lor" 2) use the unix separator '/', it works on NT too "`D:/Lor" Best dna -- SCSI is *NOT* magic. There are *fundamental technical reasons* why it is necessary to sacrifice a young goat to your SCSI chain now and then. -- John Woods