Forum: Ruby Win32 extensions??? not OLE

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.
B09671d1d2b63d00555f4a3c64670ff8?d=identicon&s=25 Rain (Guest)
on 2006-04-04 03:31
Hello
I'm new to programming and Ruby.
My question is, "does Ruby have a Windows extensions module that allows
access to windows OS? "
Something like the windows extension for Python written by Mark Hammond
where you can import OS and peform file copies, dir, get OS versions
ect..

I'm not looking for API or OLE control. Just direct OS control.
0b561a629b87f0bbf71b45ee5a48febb?d=identicon&s=25 Dave Burt (Guest)
on 2006-04-04 05:11
(Received via mailing list)
Rain wrote:
> Hello
> I'm new to programming and Ruby.
> My question is, "does Ruby have a Windows extensions module that allows
> access to windows OS? "
> Something like the windows extension for Python written by Mark Hammond
> where you can import OS and peform file copies, dir, get OS versions
> ect..
>
> I'm not looking for API or OLE control. Just direct OS control.

For direct control of Windows, you use the API.

If, however, you want a more abstract, high-level interface to files,
pathnames, etc., such as Python's os library provides, you won't find
them collected into one module. Check out classes IO, File, FileTest,
Find, FileUtils, Tempfile, Process, Pathname, and the constant ENV.

If you ask a more specific question about what you want to do, we can
probably narrow that down for you.

Cheers,
Dave
Fd77a215bd4cd6771e7a2899954a7221?d=identicon&s=25 Taisuke Yamada (Guest)
on 2006-04-04 08:34
(Received via mailing list)
If you need platform neutral interface like "file handling",
"network socket", and such, just check out class library bundled
with Ruby itself. OTOH, if you want certain OS-specific
features (like "shutting down Windows", "get OS version", etc.),
use "win32ole" module and invoke a call through obtained WMI
instance. WMI should do the job for most management tasks.

I've never heard of any wrapper library that provides simple
methods to perform common Windows management tasks. You
probably need to call/use WMI directly through "win32ole" module.
It's actually easy and more useful than limited wrapper as
tons of sample scripts (in VBScript or JavaScript) are floating
on the net, especially at MSDN site.

 > I'm new to programming and Ruby.
 > My question is, "does Ruby have a Windows extensions module that
 > allows access to windows OS? "
 > Something like the windows extension for Python written by Mark
 > Hammond where you can import OS and peform file copies, dir, get
 > OS versions ect..
 >
 > I'm not looking for API or OLE control. Just direct OS control.

--
Taisuke Yamada <tyamadajp@spam.rakugaki.org>, http://rakugaki.org/
2268 E9A2 D4F9 014E F11D  1DF7 DCA3 83BC 78E5 CD3A

Message to my public address may not be handled in a timely manner.
For a direct contact, please use my private address on my namecard.
This topic is locked and can not be replied to.