Not all ntpath.py-methods do recognize shares, do they?
David Bolen
db3l at fitlinxx.com
Mon Feb 26 17:07:52 EST 2001
"Franz GEIGER" <fgeiger at datec.at> writes:
> Any comments? Did I miss something?
When I last used this (and I just checked again), ismount() returns 1
for any directory immediately below a remote machine, whether or not
it is really a share. So this might not be safe as a general change:
E.g., A remote machine "ctwh01" has a share "sitedata" with a directory
"ni" beneath it:
os.path.ismount(r'\\ctwh01\sitedata\ni') --> 0
os.path.ismount(r'\\ctwh01\sitedata') --> 1
os.path.ismount(r'\\ctwh01\foo') --> 1
os.path.ismount(r'\\ctwh01\bar') --> 1
os.path.ismount(r'\\ctwh01\\') --> 1
But "foo", "bar" and the root directory "\" are not shares.
This was with Python 1.5.2 and Python 2.0 under NT4SP4.
If you want to treat a directory beneath a share as a directory, then
I would probably suggest that you use your own function wrapping
os.path.isdir rather than modifying the libraries themselves with
ismount() since I think that could lead to confusion in other cases.
--
-- David
--
/-----------------------------------------------------------------------\
\ David Bolen \ E-mail: db3l at fitlinxx.com /
| FitLinxx, Inc. \ Phone: (203) 708-5192 |
/ 860 Canal Street, Stamford, CT 06902 \ Fax: (203) 316-5150 \
\-----------------------------------------------------------------------/
More information about the Python-list
mailing list