Return-Path: Delivered-To: apmail-jakarta-ant-user-archive@apache.org Received: (qmail 95765 invoked from network); 30 Apr 2002 18:04:01 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 30 Apr 2002 18:04:01 -0000 Received: (qmail 26591 invoked by uid 97); 30 Apr 2002 18:03:55 -0000 Delivered-To: qmlist-jakarta-archive-ant-user@nagoya.betaversion.org Received: (qmail 26518 invoked by alias); 30 Apr 2002 18:03:54 -0000 Delivered-To: jakarta-archive-ant-user@jakarta.apache.org Received: (qmail 26504 invoked by uid 97); 30 Apr 2002 18:03:54 -0000 Mailing-List: contact ant-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list ant-user@jakarta.apache.org Received: (qmail 26492 invoked by uid 98); 30 Apr 2002 18:03:53 -0000 X-Antivirus: nagoya (v4198 created Apr 24 2002) Message-ID: <058a01c1f071$61ac7f70$6401a8c0@darden.virginia.edu> From: "Erik Hatcher" To: "Ant Users List" References: <2B5C62C548D2FC48BC0334E8AE49418518E3A2@PARROT.demandtec.com> Subject: Re: in .properties with Windows paths? (/ vs \\) Date: Tue, 30 Apr 2002 14:03:49 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N One idea that may work for you is to use the task to write the property file instead using an for some.exec.path. It will ensure that everything is escaped properly. Erik ----- Original Message ----- From: "Joshua Kneubuhl" To: Sent: Tuesday, April 30, 2002 2:01 PM Subject: in .properties with Windows paths? (/ vs \\) Hi everyone, I have some java code that references file paths from a .properties file. I'm currently using ant to do some token replacement based on absolute paths, and it is causing some troubles when running from NT. For instance, I have a foo.property file: some.exec.path=@SOME_TOKEN@ and java code: String execPath = System.getProperties().getProperty("some.exec.path"); System.out.println("I am about to Runtime.exec(" + execPath + ")"); and my ant script: When executed from a basedir of D:\foo\bar\frog (set by ant), my program outputs: "I am about to Runtime.exec(D:foobarfrog/deploy/bin/foo.exe)" (broken) If my foo.properties has some.exec.path=D:\\foo\\bar\\frog\\deploy\\bin\\foo.exe "I am about to Runtime.exec(D:\foo\bar\frog\deploy\bin\foo.exe)" (success) I saw the task, but it was not clear to me that one could pathconvert ant properties (even though a property specifies a path). This brings up another point: I would like to use ant to do "cross platform deployment" by using an NT machine to do builds (and path configuration) for UNIX boxes. If I were to do an "% ant release -Dosname=AIX" on an NT machine, all the File instances created by ant should come out as / Is it possible to tell ant to "use UNIX paths" instead of the system default? I am currently considering a custom ant task to munge all the Project properties- if run as a dependency of all other tasks, it could convert all the \ to / in the ant properties. Java File objects seem ok with / as a file separator even on Windows machines, so I think this will be ok. Cheers, josh -- To unsubscribe, e-mail: For additional commands, e-mail: -- To unsubscribe, e-mail: For additional commands, e-mail: