Test whether a path exists. Returns True for broken symbolic links
(path)
| 172 | # Being true for dangling symbolic links is also useful. |
| 173 | |
| 174 | def lexists(path): |
| 175 | """Test whether a path exists. Returns True for broken symbolic links""" |
| 176 | try: |
| 177 | os.lstat(path) |
| 178 | except (OSError, ValueError): |
| 179 | return False |
| 180 | return True |
| 181 | |
| 182 | |
| 183 | # Is a path a mount point? |