Wednesday, June 13, 2012

[Rails] Re: Opening a file having white spaces on is name with the default program

Hello,

Thanks for your answer.

I have made a put of the command

f1 = "d:/sat - Copy.png"
f1 = f1.gsub(" ", "\ ")
cmd = 'cmd /c "start ' + f1 + '"'
puts "CMD: " + cmd
system (cmd)

....and the result is the following one:

cmd /c "start d:/sat - Copy.png"

In attachment, I've putted a picture with the error.

Thanks

Regards



Colin Law wrote in post #1064223:
> On 12 June 2012 14:49, Paulo Carvalho <lists@ruby-forum.com> wrote:
>> I've tried several ways to do it but, until now, I was not able to
>> cmd = "cmd /c ""start '" + f1 + "'"""
>>
>> system (cmd)
>>
>> But no one of these solutions has worked.
>
> Have you tried inserting
> puts cmd
> then copying and pasting the output into the terminal to see if that
> works?
>
> Colin

Attachments:
http://www.ruby-forum.com/attachment/7487/err.png


--
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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate