D
Dox Xer
Hi,
i´m totally new to ruby and have a tiny little problem.
I´d like to open a file located in a specific directory on a specific
drive with spaces in the path (Vista).
Example:
"f:\abc def\new\this is my file.txt"
This seems to work fine:
File.open("f:\\abc def\\new\\this is my file.txt")
But in case i want to use a variable to do this like:
path = "f:\\abc def\\new\\this is my file.txt"
File.open(path)
I always get this error:
G:/ruby/scripts/test.rb:35:in `initialize': Invalid argument - "f:\abc
def\new\this is my file.txt" (Errno::EINVAL)
from G:/mp3val-0.1.8_with_frontend-0.1.1-bin-win32/test.rb:35:in
`open'
from G:/mp3val-0.1.8_with_frontend-0.1.1-bin-win32/test.rb:35:in
`<main>'
What do i do wrong or what do i need to add to make this working?
Thanks
Dox
i´m totally new to ruby and have a tiny little problem.
I´d like to open a file located in a specific directory on a specific
drive with spaces in the path (Vista).
Example:
"f:\abc def\new\this is my file.txt"
This seems to work fine:
File.open("f:\\abc def\\new\\this is my file.txt")
But in case i want to use a variable to do this like:
path = "f:\\abc def\\new\\this is my file.txt"
File.open(path)
I always get this error:
G:/ruby/scripts/test.rb:35:in `initialize': Invalid argument - "f:\abc
def\new\this is my file.txt" (Errno::EINVAL)
from G:/mp3val-0.1.8_with_frontend-0.1.1-bin-win32/test.rb:35:in
`open'
from G:/mp3val-0.1.8_with_frontend-0.1.1-bin-win32/test.rb:35:in
`<main>'
What do i do wrong or what do i need to add to make this working?
Thanks
Dox