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

Re: [sc-dev] String:escapeSpaces




On 29 Nov 2006, at 17:06, Stefan Kersten wrote:

Scott Wilson wrote:
File("/Users/sk/Foo Bar", "r")

and

File("/Users/sk/Foo\\ Bar", "r")

do not do the same thing ...

Sorry if I'm being dense, but don't you have one more slash than you need?

File("/tmp/Foo Bar", "w") and File("/tmp/Foo\ Bar", "w") do do the same
thing.

in this case the literal escape is handled by the parser. "/tmp/Foo Bar"
and "/tmp/Foo\ Bar" are the same string when concatenated into a shell
command and the command will choke on the unescaped whitespace.


Right! (So I am being dense... ;-)

So maybe all that needs to be done is to sort it out in a few places like Server:initClass (where program is set). I've actually just noticed String:quote, which works just as well.

If nobody objects, I'll do that.

S.