[ruby-talk:02595] Re: Ruby and WSH

From: h.fulton@...
Date: 2000-04-27 22:18:22 UTC
List: ruby-talk #2595
Andy,

Wow, that's interesting.

Will try it out.

1000000.times {print "Thanks!\n"}

Hal
>     Hal says:
>     >Anyway, I was just thinking that a Ruby interface would
>     >be a good project for someone knowledgeable about such
>     >things.
>     
> 
> Check out WIN32OLE from the archives, it uses the 
> Windows Scipting Host stuff:
> 
> #
> # You need WSH(Windows Scripting Host) to run this script.
> #
> 
> require "win32ole"
> 
> def listup(items)
> #  items.each do |i|
>   for i in items
>     puts i.name 
>   end
> end
> 
> fs = WIN32OLE.new("Scripting.FileSystemObject")
> 
> folder = fs.GetFolder(".")
> 
> puts "--- folder of #{folder.path} ---"
> listup(folder.SubFolders)
> 
> puts "--- files of #{folder.path} ---"
> listup(folder.Files)
> 
> 
> /\ndy
> 
> 
> --
> Andrew Hunt, The Pragmatic Programmers, LLC.
> Innovative Object-Oriented Software Development
> web:   http://www.pragmaticprogrammer.com   email: andy@pragmaticprogrammer.com
> --
> Our New Book: "The Pragmatic Programmer" Published by Addison-Wesley Oct 1999
>               (see www.pragmaticprogrammer.com/ppbook)
> --

In This Thread

Prev Next