ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Knox" <>
Subject RE: ant on Cygwin -- spaces in dirnames
Date Fri, 28 Feb 2003 19:15:01 GMT
Hi Eric,
I'm an emphatic cygwin and ant user. I've not had the problem that you
describe, but I'm not a believer in putting spaces in directory names.
I've never derived enough benefit from the practice that I am compelled
to use the practice. Consequently, there isn't much that I allow to be
installed into the "Program Files" directory. 

You might be able to get around the problem by making sure that the Ant
script puts quotes around the qualified directory. In other words, 'cd
"dirname" "$PRG"'. Another possible strategy would entail using a cygwin
tool called cygpath that can map semantic differences between unix and
windows path structures. There should be a man on cygpath in the cygwin

The solution to the problem is to take control of installations on your
windows machine. Installers tend to default to the Program Files
directory but in most cases (unless the program you are installing has
inappropriate dependencies on the Program Files directory) you can
install into any directory you wish.

-- dave

> -----Original Message-----
> From: Erik Price []
> Sent: Friday, February 28, 2003 10:48 AM
> To: Ant Users List
> Subject: ant on Cygwin -- spaces in dirnames
> Hi,
> I have installed Ant onto my Win2k box (which runs Cygwin) by
> downloading the ZIP binary distribution (1.5) and putting it in
> /cygdrive/c/Program Files/ant/ .  I have added the ant distribution's
> bin directory to my path, and can execute the ant wrapper script by
> calling
> localhost$ ant
> from the Cygwin command line.  The problem is that I get an error
> whenever I do run this command:
> cd: can't cd to /cygdrive/c/Program
> I have looked over the ant wrapper script and can see the problem, on
> line 52, it says:
>    # need this for relative symlinks
>    cd `dirname "$PRG"`
> The problem is that the result of `dirname "$PRG"` is a file path with
> space in it.  I would like to solve this problem.  Can anyone counsel
> in the best solution:
> 1. Manually fix the shell script by adding additional variables to
> escape the space in the pathname at every point where `dirname "$PRG"`
> is used.
> 2. Move the Ant distribution to a directory without a space.
> 3. Some other solution that I am not aware of?
> 1. is not really ideal, since it seems like unnecessary work (surely
> not the only person using ant on Cygwin) and would need to be done
> if I upgrade to a new Ant, plus it de-virginizes my ant shell script.
> 2. is not really ideal because it seems there are precious few
> directories without spaces in their names on this machine.  (I am not
> very knowledgeable of Windows.)
> I'm curious how other Cygwin users install Ant so that it works for
> them.  Am I not doing something right?  I am really inexperienced with
> both Cygwin and Windows issues so please forgive me if the solution is
> obvious.
> Erik
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

View raw message