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

Re: [sc-dev] String:escapeSpaces



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.

<sk>