finding mount points

Suchandra Thapa ssthapa at midway.uchicago.edu
Wed Jul 12 01:39:04 EDT 2000


John Clonts <jclonts at mastnet.net> wrote:
>Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>>> import posixpath
>>>> posixpath.ismount("/")
>1
>>>> posixpath.ismount("/mnt")
>0
>>>> posixpath.ismount("/mnt/dosd")
>1
>>>> posixpath.ismount("/home")
>1
>>>> posixpath.ismount("/home/john")
>0

    Actually, I wanted something like 
>>>mountpoint('/home/john') 
>/home
>>>mountpoint('/home')
>/home

I suppose I could do a recursive solution where I start with the full path
and take away directories and check to see if its a mount point using 
ismount but I was hoping there was a module or way to find the mount point
directly. 


-- 
------------------------------------------------------------------

Suchandra S. Thapa 
s-thapa at uchicago.edu

------------------------------------------------------------------



More information about the Python-list mailing list