Test whether a path exists. Returns True for broken symbolic links
(path)
| 266 | # Being true for dangling symbolic links is also useful. |
| 267 | |
| 268 | def lexists(path): |
| 269 | """Test whether a path exists. Returns True for broken symbolic links""" |
| 270 | try: |
| 271 | st = os.lstat(path) |
| 272 | except (OSError, ValueError): |
| 273 | return False |
| 274 | return True |
| 275 | |
| 276 | # Is a path a mount point? |
| 277 | # Any drive letter root (eg c:\) |