From: Bazsl Date: 2007-10-17T00:00:54+09:00 Subject: How distinguish between a file and a directory? A newbie question. The code Dir.foreach(Dir.getwd) do |f| if ((f != '.') && (f != '..')) puts f end end lists the files and directories in the current working directory but does not identify which is a file and which is a directory. How can I add that information to the listing? Thanks.