On Windows, root directories of drives don't contain "." nor "..",
and the suggested code (also Dir.entries(dirname).join == "...") doesn't work.
If it is needed in real case, this method should be adopted, I think.
Now that Ruby got a Dir.empty? method, do you think it makes sense to add a File.empty? as an alias for File.zero? ?
(I didn't know if it was worth opening a new issue for this simple suggestion, so I just appended it here, since I see Dir.empty? and File.empty? as related methods, somehow)
I commented this on #9969 as well. Given that Dir.empty? is being introduced I think it would be helpful to also introduce either Pathname#empty? (which would check if something is a file or a directory then do the respective empty check) or Pathname#empty_directory? (which would assume the path is referring to a directory).