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

Re: [sc-dev] String:escapeSpaces



Scott Wilson <sdwilson@xxxxxxxxxxxx> writes:

> On 29 Nov 2006, at 16:10, Stefan Kersten wrote:
>
>> Julian Rohrhuber wrote:
>>>> and then stick it in in the various String methods which deal with
>>>> paths?
>>>
>>> shouldn't this happen in String:standardizePath ?
>>
>> no, because spaces need only be escaped when the path is merged into a
>> shell commandline.
>>
>> 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.

A single \ escapes the following char in a string, so "\ " is really
" ".

-- 
CYa,
  Mario