chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] windows shell problem


From: Matthew Flatt
Subject: Re: [Chicken-users] windows shell problem
Date: Tue, 6 Jan 2009 05:09:28 -0700

At Tue, 6 Jan 2009 11:29:24 +0100, "felix winkelmann" wrote:
> On Mon, Jan 5, 2009 at 6:58 PM, John Cowan <address@hidden> wrote:
> > felix winkelmann scripsit:
> >
> >> The handling of backslashes as escaping characters is not the problem,
> >> it seems. If I pass this string (verbatim, just like it is printed here) to
> >> system(3):
> >>
> >> "c:\home\chicken-trunk\bin\csi" -bnq -e "(require-library setup-api)"
> >> -e "(import setup-api)" "c:\...some...path...\defstruct.setup"
> >>
> >> I get an error message that tells me that the program
> >>
> >> "c:\home\chicken-trunk\bin\csi" -bnq -e ""
> >
> > That suggests to me is that what's happening is that system(foo) is
> > spawning the shell (from $SHELL or $COMSPEC) with "/c \" + foo + "\"".
> > If foo already has quotation marks in it, you're hosed.
> 
> That would mean it is impossible to pass arguments containing whitespace.
> Can it be that bad?

If you put an extra set of quotation marks around the argument, won't
they effectively cancel the quotation marks added by system()?

That is, pass

 ""c:\home\chicken-trunk\bin\csi" -bnq -e "(require-library setup-api)"
 -e "(import setup-api)" "c:\...some...path...\defstruct.setup""

to system(), which will then send on

 """c:\home\chicken-trunk\bin\csi" -bnq -e "(require-library setup-api)"
 -e "(import setup-api)" "c:\...some...path...\defstruct.setup"""

to the shell, which will then parse out

 """c:\home\chicken-trunk\bin\csi"  =   c:\home\chicken-trunk\bin\csi

as the program name.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]