On 7/1/05, Simon Dahlbacka <[EMAIL PROTECTED]> wrote:
> On 7/1/05, Mark Hammond <[EMAIL PROTECTED]> wrote:
> > > ..but how do i find out if let's say X:\foo\bar\blarg.baz is a local
> > > path or in fact a mapped network path?
> >
> > win32api.GetLogicalDriveStrings() may also help.
> 
> I was going to say that it does not help, but then I found
> win32file.GetDriveType
> 
> so for future reference, here is a solution that WorksForMe(tm)
> 
> >>> def IsMappedDrive(name):
> ...     allDrives = win32api.GetLogicalDriveStrings().split("\x00")
> ...     return name.upper() in [drive for drive in allDrives if
> win32file.GetDriveType(drive) == win32file.DRIVE_REMOTE]
> 
> >>> IsMappedDrive("z:\\")
> True
> >>> IsMappedDrive("c:\\")
> False

Um, surely

    def IsMappedDrive(name):
        return win32file.GetDriveType(name) == win32file.DRIVE_REMOTE

works, in that case...?

Paul.
_______________________________________________
Python-win32 mailing list
Python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to