From: Robert Klemme Date: 2009-04-06T17:14:35+09:00 Subject: Re: what's wrong with these? On 06.04.2009 03:39, Humphrey Alba wrote: > Version: ruby 1.9.1p0 (2009-01-30 revision 21907) [i686-linux] > Is there something wrong with this version? > > 1: > Dir.foreach("/tmp") {|f| puts f if File.directory?(f) } > -- it just prints '.' and '..' This is because of what Dir.foreach returns: http://www.ruby-doc.org/core/classes/Dir.html#M002327 Hint: paths are missing. > 2: > puts Dir.tmpdir > Dir.mktmpdir { |i| puts i } > -- it says 'undefined method' Well, what do you conclude from that? Kind regards robert