[Tutor] How can isfile really do what it claims
Sandip Bhattacharya
lists at sandipb.net
Fri Oct 26 14:55:28 CEST 2007
$ ls -l /usr/lib/xulrunner/libfreebl3.so
lrwxrwxrwx 1 root root 20 2007-10-20 12:13 /usr/lib/xulrunner/libfreebl3.so -> ../nss/libfreebl3.so
$ python
Python 2.5.1 (r251:54863, Oct 5 2007, 13:36:32)
[GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os.path
>>> os.path.isfile("/usr/lib/xulrunner/libfreebl3.so")
True
>>> print os.path.isfile.__doc__
Test whether a path is a regular file
Is this because isfile follows symlinks? If that is the case,
how can I NOT make it do that?
- Sandip
More information about the Tutor
mailing list