From: "David A. Black" Date: 2005-08-24T03:40:31+09:00 Subject: Re: File.extname edge case bug? Hi -- On Wed, 24 Aug 2005, Daniel Berger wrote: > Hi all, > > Ruby 1.8.2 > Solaris 10 > > Should File.extname("..") return "" or "."? It currently returns ".". > > The comments in the source say that it returns an empty string if the string > provided as an argument begins with a "." and is the only "." in the string. > > I would argue that any string that begins with a ".", regardless of how many > total "." there are in the string, should return an empty string. My opinion > is based on years of convention. I have never, ever seen string that began > with "." and had an extension as well. No one ever does this afaik. > > Am I wrong? Thoughts? I see a number of them in my home directory, including: ./.mime.types ./.lynx.cfg ./.ruby.vim ./ruby/.rbconfig.time ./rubycentral/html/.index.html.swp and a ton of Emacs and svn save files of various kinds. David -- David A. Black dblack@wobblini.net