
On 21 April 2010 02:33, Greg Ewing <greg.ewing@canterbury.ac.nz> wrote:
So I think it's likely that in any particular case, the caller of hasextension() will know whether he wants case-sensitivity or not.
True, but equally, the natural reaction for any but the most careful of programmers would be to say something like hasextension(fn, '.txt') without thinking. Hence my assertion that it's an attractive nuisance. In practice, it's no worse than splitext(fn) == '.txt', but it gives the impression that it should do a better job (even though, as you say, it can't). Once you get beyond the most basic operations, filename handling is hard. (I haven't even touched on MacOS unicode normalisation issues yet...) Getting it 90% right is easy (99% if you cover case sensitivity) - it's that last 1% that bites. (And yes, the 90%/99% split is, in my view, about accurate). Paul.