Split a pathname into drive/UNC sharepoint and relative path specifiers. Returns a 2-tuple (drive_or_unc, path); either part may be empty. If you assign result = splitdrive(p) It is always true that: result[0] + result[1] == p If the path contained a drive letter, d
(p, /)
| 144 | # colon) and the path specification. |
| 145 | # It is always true that drivespec + pathspec == p |
| 146 | def splitdrive(p, /): |
| 147 | """Split a pathname into drive/UNC sharepoint and relative path specifiers. |
| 148 | Returns a 2-tuple (drive_or_unc, path); either part may be empty. |
| 149 | |
| 150 | If you assign |
| 151 | result = splitdrive(p) |
| 152 | It is always true that: |
| 153 | result[0] + result[1] == p |
| 154 | |
| 155 | If the path contained a drive letter, drive_or_unc will contain everything |
| 156 | up to and including the colon. e.g. splitdrive("c:/dir") returns ("c:", "/dir") |
| 157 | |
| 158 | If the path contained a UNC path, the drive_or_unc will contain the host name |
| 159 | and share up to but not including the fourth directory separator character. |
| 160 | e.g. splitdrive("//host/computer/dir") returns ("//host/computer", "/dir") |
| 161 | |
| 162 | Paths cannot contain both a drive letter and a UNC path. |
| 163 | |
| 164 | """ |
| 165 | drive, root, tail = splitroot(p) |
| 166 | return drive, root + tail |
| 167 | |
| 168 | |
| 169 | try: |
searching dependent graphs…