
April 21, 2010
2:18 a.m.
Paul Moore wrote:
As Mike Meyer explained, whether file foo.C "has extension .c" depends (as far as the user is concerned) on whether the filesystem it's on is case sensitive.
I don't think that's really true. It's common to find, e.g., files ending with .jpg, .JPG, or other variations on a case-sensitive filesystem that got there by being copied from a case-insensitive one, or simply created by people using tools that don't care about the case of the extension. Seems to me the best thing to do is always compare extensions case-insensitively unless you have a specific reason to do otherwise. So I would recommend that any proposed hasextension() function should be case-insensitive by default. -- Greg