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

Steven D'Aprano steve at REMOVE-THIS-cybersource.com.au
Tue Oct 21 00:49:13 CEST 2008


On Mon, 20 Oct 2008 23:56:22 +0200, Stef Mientki wrote:

> Bruno Desthuilliers wrote:
>> Eric Wertman a écrit :
>>>>> I (again) wonder what's the perfect way to store, OS-independent,
>>>>> filepaths ?
>>>
>>> I'm in agreement that perfect probably isn't applicable.  If I were
>>> doing this myself, I might store the information in a tuple:
>>>
>>> base = 'some root structure ('/' or 'C')
>>
>> make it "C:\"
> wouldn't " C:/"  be more universal and therefor better ?


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.


-- 
Steven



More information about the Python-list mailing list