Forum: Ruby Several units of the System, Help!

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
411f863b28b1a9427e43b809f87291be?d=identicon&s=25 Darkskull Darkskull (darkskull)
on 2008-12-11 18:19
Hi, I have a little doubt with a code that I'm doing, and that is what I
need is to open a file with "File", with the exact route, but saying
that I look at all the units of the system, or the 'A' to 'Z'. How could
I do?, Here you get the code.

require 'ftools'
ip=ARGV[0]
dns=ARGV[1]
if !ARGV[0] or !ARGV[1]
  puts "Example use => \"./phar 72.14.221.104 google.es\""
end
host=File.open('C:/Windows/System32/drivers/etc/hosts' , 'a+')
host.print("#{ip}\s\s\s\s", "#{dns}\n")

This is: " ...===> C: <===/Windows/System32/... "
This topic is locked and can not be replied to.