- C:\Windows>irb
- irb(main):001:0> mydir=Dir.new('.')
- => #<Dir:.>
- irb(main):002:0> mydir.methods
- => [:path, :to_path, :inspect, :read, :each, :rewind, :tell, :seek, :pos, :pos=, :close, :to_a, :entries,
- send, :respond_to?, :respond_to_missing?, :extend, :display, :method, :public_method, :define_singleton_me
- irb(main):003:0> p mydir.entries
- [".", "..", "addins", "AppCompat", "AppPatch", "assembly", "bfsvc.exe", "Boot", "bootstat.dat", "Branding"
- ", "setupact.log", "setuperr.log", "ShellNew", "SoftwareDistribution", "Speech", "splwow64.exe", "Starter.
- => [".", "..", "addins", "AppCompat", "AppPatch", "assembly", "bfsvc.exe", "Boot", "bootstat.dat", "Brandi
- tup", "setupact.log", "setuperr.log", "ShellNew", "SoftwareDistribution", "Speech", "splwow64.exe", "Start
- irb(main):004:0>
复制代码 |