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 ?

path = ['some','set','of','path','names']
filename = 'somefile.ext'

pathdata = (root,path,filename)

and write a couple of simple functions to reconstruct them based on the os.

like, err, os.path.join ?
Yes (because these functions don't function correctly with i.e pdb, which might be due to bugs in pdb).
cheers,
Stef
--
http://mail.python.org/mailman/listinfo/python-list

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to