Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#1299 Problem with space in output paths

closed-fixed
Borut Ražem
5
2013-05-25
2007-02-26
Steve
No

If you specifie an output path with -o and this path contains a space even if it's written with brackets it returns an error.

F:\Projects\test3>sdcc.exe -c test.c -o "F:\Projects\test3\output 1\"
test.c:11: error 4: 'fopen' failed on file 'F:\Projects\test3\output 1".asm'

sdcc.exe -v

SDCC : mcs51/gbz80/z80/avr/ds390/pic16/pic14/TININative/xa51/ds400/hc08 2.6.0 #4
309 (Jul 28 2006) (MINGW32)

Discussion

  • Raphael Neider
    Raphael Neider
    2007-02-26

    • milestone: --> 100455
    • status: open --> pending-invalid
     
  • Raphael Neider
    Raphael Neider
    2007-02-26

    Logged In: YES
    user_id=1115835
    Originator: NO

    > sdcc.exe -c test.c -o "F:\Projects\test3\output 1\"
    You must not escape the closing qoute, try
    sdcc.exe -c test.c -o "F:\Projects\test3\output 1"

    Note: no backslash after test3\output 1

    HTH,
    Raphael

     
  • Maarten Brock
    Maarten Brock
    2007-02-26

    Logged In: YES
    user_id=888171
    Originator: NO

    I doubt that is the right solution. Without the last backslash it's a filename to SDCC instead of a directory.

    So how about providing the full path including the filename: -o "F:\Projects\test3\output 1\test.rel"

    Or try to use unix-style seperators: -o "F:/Projects/test3/output 1/"

     
  • Steve
    Steve
    2007-02-27

    Logged In: YES
    user_id=1689471
    Originator: YES

    I tested it without the last backslash an got an output file named output 1

    also tried the unix style with slashes and got same result.

     
  • Steve
    Steve
    2007-02-27

    • status: pending-invalid --> open-invalid
     
  • kosmonaut_pirx
    kosmonaut_pirx
    2007-03-04

    Logged In: YES
    user_id=1411903
    Originator: NO

    just tried

    sdcc-snapshot20070304/bin/sdcc --stack-loc 0x044F --data-loc 0x0050 --xram-loc 0x0100 --model-large --nooverlay -I. -mhc08 --out-fmt-s19 --verbose -V --debug -o "bla fasel.s19" *.rel

    without any problem on fedora core 6.

    my suggestion is to close this. it's most likely an user error.

     
  • Borut Ražem
    Borut Ražem
    2007-04-29

    Logged In: YES
    user_id=568035
    Originator: NO

    The proper soultion is:
    sdcc.exe -c test.c -o "F:\Projects\test3\output 1\\"
    so that the ending backslash is escaped and the ending quote does it's usual job; or simply
    sdcc.exe -c test.c -o "C:/Projs/test3/output 1/".
    In both cases the otput files are created in "output 1" directory.

    Borut

     
  • Borut Ražem
    Borut Ražem
    2007-04-29

    • status: open-invalid --> closed-works-for-me
     
  • Maarten Brock
    Maarten Brock
    2007-04-29

    Logged In: YES
    user_id=888171
    Originator: NO

    Borut,

    I think it's counter-intuitive for win32 users to have to use unix-style paths or escapes to make this work. One never needs escapes on win32 paths. This is also not documented behaviour. This is what I call a workaround.

    I usually do not want to go against an administrator but I strongly suggest to reopen this bug.

    Maarten

     
  • Borut Ražem
    Borut Ražem
    2007-04-29

    Logged In: YES
    user_id=568035
    Originator: NO

    Maarten,

    this time I don't agree with you: what you call "unix-style paths" are also win32 paths: majority (if not all?) of Windows applications accept them (you can try with Notepad...). Sometimes you have to surround the path with quotes, so that the application don't mess them with command line options starting with "/". This worked on DOS too if the application didn't break it...

    Escapes are also handled by cmd.exe and were also in DOS times by command.com.

    I think that we should teach the users that they exist and how to use them.

    After all, what do you think is the right solution? To fix cmd.exe ;-) ?

    Borut

     
  • Maarten Brock
    Maarten Brock
    2007-04-29

    Logged In: YES
    user_id=888171
    Originator: NO

    Borut,

    I just remembered, instead of putting the backslash inside the quotes you can put it after the quotes. Like this:
    sdcc.exe -c test.c -o "F:\Projects\test3\output 1"\

    This also works with command line completion in cmd.exe as you have to add a backslash after every directory there yourself too if you want to browse into it. Try typing: 'dir c:\pro[TAB]\sd[TAB]\bin' and it shows 'dir c:\Program Files\SDCC\bin'

    I doubt there are many native dos/win programs that can handle unix paths. But if you say it works, I do not question that, even though I've never heard of it. The same goes for escapes. Anyway I thought there would have been an easy way to get the command line argument as typed, but that doesn't seem to be the case.

    But that doesn't take away my other option, documentation. Teaching users is not done in bugs obscured by closure. Will you please add this to the manual?

    Maarten

     
  • Borut Ražem
    Borut Ražem
    2007-04-29

    • status: closed-works-for-me --> open-works-for-me
     
  • Borut Ražem
    Borut Ražem
    2007-04-29

    Logged In: YES
    user_id=568035
    Originator: NO

    > I doubt there are many native dos/win programs that can handle unix paths.
    > But if you say it works, I do not question that, even though I've never
    > heard of it.

    Unix paths are handled on the lowest WIN32 API level. If the application code doesn't corrupt them, they work "out of the box".

    An other thought: the average Windows user doesn't know anything about the DOS prompt, so using the command line utilities is a rocket science for him. I think that SDCC user's knowledge is a little bit more advanced...

    > But that doesn't take away my other option, documentation. Teaching users
    > is not done in bugs obscured by closure. Will you please add this to the
    > manual?

    I definitely agree with you abut that. I'll try to find the appropriate place where to document it. So I'll reopen the bug until the docummentation is updated.

    Borut

     
  • Borut Ražem
    Borut Ražem
    2007-04-30

    • assigned_to: nobody --> borutr
    • milestone: 100455 --> fixed
    • labels: 101551 --> Documentation
    • status: open-works-for-me --> closed-fixed
     
  • Borut Ražem
    Borut Ražem
    2007-04-30

    Logged In: YES
    user_id=568035
    Originator: NO

    Fixed in svn revision #4782: documented how to use paths with spaces for Windows users.

    Borut