What's the perfect (OS independent) way of storing filepaths ?

Eric Wertman ewertman at gmail.com
Tue Oct 21 01:01:15 CEST 2008

> Do you really think there are Linux or Mac systems with a C: drive?
> This whole question is based on the ludicrous assumption that general
> file system paths can be platform-independent. That's a bit like trying
> to write code that is programming language-independent.

That's sort of where I was going originally... just pick a way to
store the path elements and write some simple functions (yes, many of
them will just be os.path calls) to reconstruct them based on the
actual needs of the application.  If your root element is in
ascii.letters  then it's most likely windows machine, so adding a ':'
and using os.path.join would be appropriate in the function.

More information about the Python-list mailing list