[Z88dk-users] Absolute file names with spaces...

Bridge to the z88dk-users mailing list
Post Reply
obiwanjacobi
Member
Posts: 67
Joined: Tue Dec 22, 2015 7:39 am

[Z88dk-users] Absolute file names with spaces...

Post by obiwanjacobi »

I am trying to call zcc with an absolute file path. The path has spaces in them and I use "" around the full path.

Code: Select all

zcc +zalt -clib=sdcc_iy --max-allocs-per-node200000 "c:\Users\marc\Documents\Hardware Projects\Zalt\Source\z88dk target\_tests\HelloWorld-printf\helloworld.c"
I get an error that seems to indicate that the path is not passed correctly internally from one tool to the next...
Error: cannot read file 'c:\Users\marc\Documents\Hardware.o'
Is there any way to get this to work?



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
stefano
Well known member
Posts: 1534
Joined: Mon Jul 16, 2007 7:39 pm

Post by stefano »

I am trying to call zcc with an absolute file path. The path has spaces in them and I use "" around the full path.
IIRC the path conversion partially depends on the way z88dk is built.
Using MinGw, cygwin or Visual C permit different path conversion capabilities.



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
alvin
Well known member
Posts: 1872
Joined: Mon Jul 16, 2007 7:39 pm

Post by alvin »

I am trying to call zcc with an absolute file path. The path has spaces in them and I use "" around the full path.
IIRC the path conversion partially depends on the way z88dk is built.
Using MinGw, cygwin or Visual C permit different path conversion capabilities.
There may also be something in how zcc separates the basename from the path. I added some stuff for quoted strings passed to options but I'm not sure if that is invoked for filename processing. I'll try to have a look in the next couple of days.



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
alvin
Well known member
Posts: 1872
Joined: Mon Jul 16, 2007 7:39 pm

Post by alvin »

I tried a quick fix that quoted all input and output filenames in shell commands. It worked but the solution is not complete. We also have to quote include and library paths.

Example shell commands generated by zcc:


copy "src/misc.asm" "C:\...\Temp\zccD2503.asm" > nul

z80asm -D.... -o"demo" -Ic:\Projects\z80\z88dk\... "c:\projects\z80\..." "c:\..\Temp\zccD2503.asm"


The quoting solves the space issue for filenames but there must also be quoting around include and library paths which I haven't tried to do yet. The entire -o parameter must be quoted so that the shell removes the outer quotes before invoking the tool; that was my mistake.

I think there is more work involved in this so I will leave it alone until after the release.



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
alvin
Well known member
Posts: 1872
Joined: Mon Jul 16, 2007 7:39 pm

Post by alvin »

Spaces should now be accepted in paths and filenames following this fix:
https://github.com/z88dk/z88dk/issues/3

The fix will be present in the Jan 21 build:
https://www.z88dk.org/forum/viewforum.php?id=19



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
Post Reply