From: Josh Charles Date: 2005-09-08T05:24:14+09:00 Subject: FileTest.directory?( x ) weird behavior I have a bit of code I'm working on where I need to seperate the directories from the files. Currently, it's processing the first three properly and skipping the rest. I'm running this on windows. Here is the code: def GetFolders rtn = "" Dir.foreach( @userFilePath ) do |x| if FileTest.directory?( x ) rtn += "" unless x <= ".." end end return rtn end def GetFiles rtn = "" Dir.foreach( @userFilePath ) do |x| rtn += "" unless FileTest.directory?( x ) end return rtn end It gives the output of: The actual directory contains: . .. 404.html 500.html asdf asdnt.txt silk test thingy.html 4 File(s) 567 bytes 5 Dir(s) 22,350,041,088 bytes free I'm still learning ruby, so I've probably written something incorrectly... Josh