> 
> 
> Hi Jesus and thanks for answering.
> 
> i tried this, but the result is the same. Only the slashes in the error 
> message are now different accordingly to the changed path variable.
> 
> I already tried a lot of different options like changing the slashed, 
> adding additionally escaping "\" for each slash and for the blanks as 
> well, but the result is always the same.
> 
> I can open the file when i enter the path directly (also with 
> "\"-slashes), but using a variable in between leeds to this error.
> 
> btw: i made a smaller mistake while posting my example. The filename is 
> "p1 - this is my file.txt". I don't know, if the "-" is also a special 
> character, so i escaped this one as well...no luck.



Ok, got it. This is slightly confusing. I hope, the rest of Ruby makes 
more sense.

This works:
file = File.open("G:\\abc Test\\test - Doc.txt")

and

s = "G:\\abc\ Test\\test - Doc.txt"
File.open(s)

In case a variable should be used, the space in the name of the 
directory must be escaped. The one in the filename is not important. 
Strange strange.....


-- 
Posted via http://www.ruby-forum.com/.