On 25/09/2010 04:25, Steven D'Aprano wrote: > 1. Return the case of a filename in some canonical form which depends > on the file system? > 2. Return the case of a filename as it is actually stored on disk? How do 1 and 2 differ? FWIW, the use case that setuptools has (and for which it currently incorrectly uses normpath) is number 2. > 4. Return the case of a filename in some arbitrarily-chosen canonical > form which does not depend on the file system? This is what normpath does, but only if you're on Windows ;-) I still don't really get the use case of normpath in its current form, at all... > Various people have posted links to recipes that solve case #2. Note > though that this necessarily demands that if the file doesn't exist, it > should raise an exception. Fine by me, shame it seems to require iteration to find an answer though :-S > The very concept of canonical form for file names is troublesome. I would have thought "whatever is shown when doing an ls/dir/etc" (and don't be smart and think about mentioning that oyu can get dir to output 8.3 as well as the full path ;-) ) Chris -- Simplistix - Content Management, Batch Processing & Python Consulting - http://www.simplistix.co.uk
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4