[Python-Dev] w32 drive separator (was: Drive suffix)

Oleg Broytman phd at phd.pp.ru
Wed Aug 4 17:08:20 CEST 2010


On Wed, Aug 04, 2010 at 03:45:45PM +0100, Rob Cliffe wrote:
> Is there a way of determining the suffix used after a drive letter to denote a drive, e.g. on Windows the ":" in r"C:\Dir\Subdir\File.Ext" ?  Or is the colon so universal that it is considered unnecessary?  Should it be in the os module somewhere (as far as I can tell, it isn't, although every other kind of file path component separator seems to be) ?

   It's not universal, exactly opposite - it's specific to a rare graphic
environment produced by a small company based in Redmond... sorry, I cannot
resist. (-:
   Because of this (':' being too specific) it's built right into ntpath.py
- the module that 'os' module imports when it finds itself running inside
that graphic environment. It's used as a character constant all over
ntpath.py without any name.

Oleg.
-- 
     Oleg Broytman            http://phd.pp.ru/            phd at phd.pp.ru
           Programmers don't die, they just GOSUB without RETURN.


More information about the Python-Dev mailing list