Hello,
In my rails application, I have a file which name is: "d:/Copy of
t.txt".
I want to open it with the default program.
This file is a TXT file but it can be another kind of file (png, pdf,
etc) and can have, or not, white spaces on his path/name.
I've tried several ways to do it but, until now, I was not able to
accomplish by goal.
I have tried:
f1 = "d:/Copy of t.txt"
#system %{cmd /c "start #{f1}"}
#cmd = 'cmd /c "start ' + f1 + '"'
#cmd = 'cmd /c """start ' + f1 + '"""'
#cmd = "cmd /c ""start '" + f1 + "'"""
cmd = "cmd /c ""start '" + f1 + "'"""
system (cmd)
But no one of these solutions has worked.
Anyone can help me?
Thank you
Best regards
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.