Sophie

Sophie

distrib > CentOS > 5 > x86_64 > by-pkgid > 6d36cb72372cfb7c8fee63f4d6dc0530 > files > 127

ruby-docs-1.8.5-31.el5_9.x86_64.rpm

#
# 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)