On Thu, Aug 25, 2011 at 2:39 AM, Stephen J. Turnbull <stephen at xemacs.org> wrote: > If our process is working with an external process (the OS's file > system driver) whose definition includes the statement that "File > names are sequences of Unicode characters", Does any OS actually say that? Don't they usually say "in a specific normal form" or "they're just bytes"? > then C6 says our process > must compare canonically equivalent sequences that it takes to be file > names as the same, whether or not they are in the same normalized > form, or normalized at all, because we can't assume the file system > will treat them as different. If we do treat them as different, our > users will get very upset (eg, if we don't signal a duplicate file > name input by the user, and then the OS proceeds to overwrite an > existing file). The solution here is to let the OS do the check, e.g. with os.path.exists() or os.stat(). It would be wrong to write an app that checked for file existence by doing naive lookups in os.listdir() output. -- --Guido van Rossum (python.org/~guido)
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