From: Matt Armstrong Date: 2002-03-19T16:36:49+09:00 Subject: Re: dots in Dir.entries matz@ruby-lang.org (Yukihiro Matsumoto) writes: > Could you summarize pros and cons for filtering dot files (. and ..) > from Dir.entries and Dir.each, please? This is from my memory of the thread. Pros: - Convenience -- you rarely need them, and often they get in the way, requiring code like this over and over: next if ['.', '..'].include?(dir) - Portability -- some file systems don't have '.' and '..', so code depending on it won't be as "portable." - The '.' and '..' are not _really_ a member of the directory. They exist as an implementation artifact of the file system. Cons: - The '.' and '..' are returned as directory entries by the OS, so Ruby should include them too. - If an application needs to have '.' and '..' included, it has to add them manually. Personally, I think filtering makes Ruby more convenient and so is a good thing. -- matt