ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject RE: UNC paths
Date Wed, 11 Jul 2001 23:10:44 GMT
For what it's worth, all of the following tests work on my machine

C:\>java -version
java version "1.3.1"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1-b24)
Java HotSpot(TM) Client VM (build 1.3.1-b24, mixed mode)

C:\>ant -version
Ant version 1.3 compiled on May 3 2001

<?xml version="1.0"?>
<project name="Ant" default="main" basedir=".">
  <property name="src" value="." />
  <property name="unc" value="\\spr121015\bin" />
  <property name="cnu" value="//spr121015/bin" />
  <target name="main" depends="unc, varUnc, cnu, varCnu" />

  <target name="unc">
     <copy file=".\build.xml" todir="${unc}" />

  <target name="varUnc">
     <copy file=".\build.xml" todir="\\spr121015\bin" />

  <target name="cnu">
     <copy file=".\build.xml" todir="${cnu}" />

  <target name="varCnu">
     <copy file=".\build.xml" todir="//spr121015/bin" />

-----Original Message-----
From: shankar []
Sent: Wednesday, July 11, 2001 5:55 PM
To: ant-user
Cc: shankar; holtdl
Subject: RE: UNC paths

Again, the answer depends on whether you (or rather, the task in 
question) are interpreting that path inside Java code, or if you are 
spawning a shell to do something with that path.
The default shell (CMD.EXE) on Windows NT insists on seeing the UNC 
path with backslashes () only. I.e. it only wants \host.
On the other hand, inside the kernel, NT is perfectly happy with both 
*forward* and backward slashes. So a "UNC" path of the form 
//host/resource/path is quite usable from within applications, or even 
alternate shells. 
You can see this for yourself, by just opening a UNC of the form 
"//host/resource/path" as a FileInputStream, and reading its contents..
However, *some* of the Ant tasks seem to spawn a native shell to do 
their work (don't quite know which yet), and those may not work with 
forward-slashed UNCs. But most tasks should work just fine.
(If you are passing in UNCs to ant from the command line on Windows NT, 
you can *still* use forward-slashes. CMD.EXE is only picky about its 
own direct file or path arguments - arguments sent to spawned children 
can contain forward slashes..)
> -----Original Message----- 
> From: Matt Lyon [] 
> Sent: Wednesday, July 11, 2001 12:58 PM 
> To: 
> Cc: 
> Subject: UNC paths 
> Diane, 
> Thanks for the response. 
> I do have another question, however. I noticed that in an  
> earlier post you 
> had asked if Ant knows how to handle UNC path conventions, 
> like a "\" in 
> paths: 
> Did you ever get an answer on that? 
> I am trying to specify a UNC path for the destdir parameter 
> in my javadoc 
> task, but Ant appears to just be ignoring the first slash in 
> the UNC path 
> and bonking. I could write an ftp task to handle uploading 
> the javadocs to 
> the remote machine, but I am just being lazy and looking for 
> an easy way to 
> do it. Since cmd.exe (a.k.a. the good ol' DOS prompt window) does not 
> support UNC paths, it's no surprise that Ant doesn't either. 
> Just curious... 
> Cheers, 
> Matt 
> -----Original Message----- 
> From: Diane Holt [] 
> Sent: Wednesday, July 11, 2001 12:56 PM 
> To: 
> Subject: Re: Formatting HTML text using javadoc "bottom" parameter 
> --- Matt Lyon <> wrote: 
> > bottom="<i>Copyright ) 2000 Dummy Corp. All Rights Reserved.</i>">

> The example has been corrected in CVS. See: 
Click on "(as text)" to see the formatted file. 

Do You Yahoo!? 
Get personalized email addresses from Yahoo! Mail 

View raw message