From: Dox Xer Date: 2010-09-12T00:59:09+09:00 Subject: Re: Simply open a file using a variable Jesús Gabriel y Galán wrote: > On Sat, Sep 11, 2010 at 4:42 PM, Dox Xer wrote: >> This seems to work fine: >> `open' >> � � � �from G:/mp3val-0.1.8_with_frontend-0.1.1-bin-win32/test.rb:35:in >> `
' >> >> >> What do i do wrong or what do i need to add to make this working? > > I can't test it now in Windows but I seem to recall that you can use > forward slashes even in Windows: > > path = "f:/abc/def/new/this is my file.txt" > > Can you try that? > > Jesus. 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. -- Posted via http://www.ruby-forum.com/.