Return the parent directory path of a file or directory `path`. The returned directory has a trailing path separator unless with_trail is False.
(path, force_posix=False, with_trail=True)
| 209 | |
| 210 | |
| 211 | def parent_directory(path, force_posix=False, with_trail=True): |
| 212 | """ |
| 213 | Return the parent directory path of a file or directory `path`. |
| 214 | The returned directory has a trailing path separator unless with_trail is False. |
| 215 | """ |
| 216 | left, _right = split_parent_resource(path, force_posix) |
| 217 | use_posix = force_posix or is_posixpath(path) |
| 218 | sep = "/" if use_posix else "\\" |
| 219 | trail = sep if with_trail and left != sep else "" |
| 220 | return left + trail |
| 221 | |
| 222 | |
| 223 | def file_base_name(path, force_posix=False): |