Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Fixing Ant build that fails due to space in path

Reply
Thread Tools

Fixing Ant build that fails due to space in path

 
 
eran
Guest
Posts: n/a
 
      08-05-2008
Hi,

Iím trying to run an installation that uses Ant. The installation has
to update some files that are in an existing folder. The folder is
supposed to be assigned to a certain environment variable, which the
Ant script relies on. The problem is this: the folder contains a space
(program files...), and that breaks the installation.

The script is along the line of:
<exec dir="${AS_HOME}/bin" executable="cmd.exe" ... >
where AS_HOME contains the space. Iím not sure this exact command
fails, as there are others in the build.xml as well, but they all look
similar. I tried to wrap the path in the env. variable with quotes, to
no avail. I donít mind changing the XML to a fixed path, but obviously
using more quotes above will do more harm than good.

Iím not familiar with Ant, and I donít have the time to learn how to
use it properly. I just need this problem to be solved. Can anyone
tell me how can I make it work with spaces in the given path?
 
Reply With Quote
 
 
 
 
Gilbert Rebhan
Guest
Posts: n/a
 
      08-05-2008
eran schrieb:
> The script is along the line of:
> <exec dir="${AS_HOME}/bin" executable="cmd.exe" ... >
> where AS_HOME contains the space. Iím not sure this exact command

[ ... ]
> Iím not familiar with Ant, and I donít have the time to learn how to
> use it properly. I just need this problem to be solved. Can anyone
> tell me how can I make it work with spaces in the given path?


the usual solution for probs withs spaces in path is =

"'...'" ,means try

<exec dir="'${AS_HOME}/bin'" executable="cmd.exe" ... >

if you're not sure, whether your property has spaces or not,
simply put it between those extra '...' and you're done.


Regards, Gilbert
 
Reply With Quote
 
 
 
 
Lew
Guest
Posts: n/a
 
      08-07-2008
eran wrote:
> Anyway, I eventually found a simple solution: I mapped the folder as a
> network drive, and that made the path much shorter, and without any
> spaces. So instead of "C:\program files\xyz" [sic], I was able to work with
> "F:\xyz".


or "C:\PROGRA~1\xyz"

--
Lew


- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
[Zionism, fascism, ethnic cleansing, terrorism, war crimes, Khasars,
Illuminati, NWO]

"The epithet "anti-Semitism" is hurled to silence anyone,
even other Jews, brave enough to decry Israel's systematic,
decades-long pogrom against the Palestinian Arabs.

Because of the Holocaust, "anti-Semitism" is such a powerful
instrument of emotional blackmail that it effectively pre-empts
rational discussion of Israel and its conduct.

It is for this reason that many good people can witness
daily evidence of Israeli inhumanity toward the "Palestinians'
collective punishment," destruction of olive groves,
routine harassment, judicial prejudice, denial of medical services,
assassinations, torture, apartheid-based segregation, etc. --
yet not denounce it for fear of being branded "anti-Semitic."

To be free to acknowledge Zionism's racist nature, therefore,
one must debunk the calumny of "anti-Semitism."

Once this is done, not only will the criminality of Israel be
undeniable, but Israel, itself, will be shown to be the
embodiment of the very anti-Semitism it purports to condemn."

--- Greg Felton,
Israel: A monument to anti-Semitism

 
Reply With Quote
 
eran
Guest
Posts: n/a
 
      08-07-2008
Thanks, Gilbert, but that didn't work. I can't say I payed a lot of
attention to the way I tried to use your solution - just wrapped the
path everywhere with the apostrophe.

Anyway, I eventually found a simple solution: I mapped the folder as a
network drive, and that made the path much shorter, and without any
spaces. So instead of "C:\program files\xyz", I was able to work with
"F:\xyz".
 
Reply With Quote
 
Gilbert Rebhan
Guest
Posts: n/a
 
      08-08-2008
eran schrieb:
> Thanks, Gilbert, but that didn't work. I can't say I payed a lot of
> attention to the way I tried to use your solution - just wrapped the
> path everywhere with the apostrophe.


> Anyway, I eventually found a simple solution: I mapped the folder as a
> network drive, and that made the path much shorter, and without any
> spaces. So instead of "C:\program files\xyz", I was able to work with
> "F:\xyz"


OK, good you found a solution.

I had several occasions where the "'...'" hack worked for me (f.e.
cvs modulenames with spaces, or path with spaces) but maybe it
doesn't work always.

But remember - like Lew also said in this thread - NEVER use a path
with spaces in it if possible,thank you Bill for
"Documents and Settings , Dokumente und Einstellungen


Regards, Gilbert





 
Reply With Quote
 
Lew
Guest
Posts: n/a
 
      08-08-2008
Gilbert Rebhanwrote:
> I had several occasions where the "'...'" hack worked for me (f.e.


That's not a hack, that's how you include "special" but legal
characters.

> cvs modulenames with spaces, or path with spaces) but maybe it
> doesn't work always.
>
> But remember - like Lew also said in this thread - NEVER use a path
> with spaces in it if possible,


I never said that. Do not misquote me.

I did say that it is weird to put things under "Program Files/", but
that isn't because of the space, it's because "Program Files/" is for,
well, program files, not development files.

I find no problem using paths with spaces in them. I do not recommend
avoiding them. I did say to think about how to use quote marks, and
not to use them randomly in ignorance.

--
Lew

 
Reply With Quote
 
Gilbert Rebhan
Guest
Posts: n/a
 
      08-08-2008
Lew schrieb:
> Gilbert Rebhanwrote:
>> I had several occasions where the "'...'" hack worked for me (f.e.

>
> That's not a hack, that's how you include "special" but legal
> characters.


I call it a 'hack' because normally i do not need such
special treatment, apart from xml entities (quot,amp,lt,gt ....)
sometimes or putting stuff between <![CDATA[ ... ]]>
as ant scripts are xmlfiles.

> I never said that. Do not misquote me.
> I did say that it is weird to put things under "Program Files/", but
> that isn't because of the space ...


Ok, seems i got you wrong

> ... it's because "Program Files/" is for,
> well, program files, not development files.


+1, I used to have an own partition on windows
for system only, another for documents and settings, another
for projects only ..., Separating stuff or using a standard
project layout = /src, /bin, /dist , /libs, /doc ... is another
story

> I find no problem using paths with spaces in them. I do not recommend
> avoiding them.


I recommend to avoid them, as they are often a source of trouble.
A space in a filename /pathname maybe legal, but there's a bunch
of programs and libraries that do not handle legal filenames.
I would not recommend using german umlauts for path or
filenames either, even if they are allowed.

I did say to think about how to use quote marks, and
> not to use them randomly in ignorance.


I did not say to use quote marks randomly but
"...'path/with spaces in it/' ..."

Using the 8.3 equivalent name you get via dir /x ...

C:\>dir /x
....

01.11.2007 13:45 <DIR> DOKUME~1 Dokumente und Einstellungen
07.06.2008 21:03 <DIR> ghc
01.11.2007 14:04 <DIR> POSTIN~1 Postinstall
15.06.2008 13:45 <DIR> PROGRA~1 Programme
13.02.2008 10:29 <DIR> ruby
15.07.2008 21:03 <DIR> totalcmd
28.05.2008 21:53 <DIR> WINXP

.... maybe a solution too, but why not simply using pathnames
without spaces or spaces replaced with '_' instead.
Makes life so much easier IMO


Regards, Gilbert


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
problem in running a basic code in python 3.3.0 that includes HTML file Satabdi Mukherjee Python 1 04-04-2013 07:48 PM
SWsoft Acronis Disk Director Suite 9.0 Build 508, Acronis OS Selector 8.0 Build 917, Acronis Partition Expert 2003 Build 292, Acronis Power Utilities 2004 Build 502, F-SECURE.ANTI vIRUS.PROXY v1.10.17.WINALL, F-SECURE.ANTI vIRUS v5.50.10260 for CITRI vvcd Computer Support 0 09-25-2004 01:38 AM
Why Python style guide (PEP-8) says 4 space indents instead of 8 space??? 8 space indents ever ok?? Christian Seberino Python 21 10-27-2003 04:20 PM
Re: Why Python style guide (PEP-8) says 4 space indents instead of8 space??? 8 space indents ever ok?? Ian Bicking Python 2 10-23-2003 07:07 AM
Stack space, global space, heap space Shuo Xiang C Programming 10 07-11-2003 07:30 PM



Advertisments