Full splitting of a file's pathname

Kerry, Richard richard.kerry at siemens.com
Mon Jul 10 10:59:41 EDT 2006


Unless it's the sort of operating system that uses something like :

Sys$disk:[foo.bar.moo.lar]myfile.txt


(VaxVMS, from quite a few years ago)
And if I recall, the parsing function provided would also separate the
extension from the main part of the file's name.


Unhelpfully,
Richard.

 

-----Original Message-----
From: python-list-bounces+richard.kerry=siemens.com at python.org
[mailto:python-list-bounces+richard.kerry=siemens.com at python.org] On
Behalf Of BartlebyScrivener
Sent: 10 July 2006 15:52
To: python-list at python.org
Subject: Re: Full splitting of a file's pathname

I don't know if it's "standard," but why not just:

dir = './foo/bar/moo/lar/myfile.txt'
dir.split('/')

['.', 'foo', 'bar', 'moo', 'lar', 'myfile.txt']

rd

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



More information about the Python-list mailing list