Create a new directory at this given path.
(self, mode=0o777, parents=False, exist_ok=False)
| 1202 | os.close(fd) |
| 1203 | |
| 1204 | def mkdir(self, mode=0o777, parents=False, exist_ok=False): |
| 1205 | """ |
| 1206 | Create a new directory at this given path. |
| 1207 | """ |
| 1208 | try: |
| 1209 | os.mkdir(self, mode) |
| 1210 | except FileNotFoundError: |
| 1211 | if not parents or self.parent == self: |
| 1212 | raise |
| 1213 | self.parent.mkdir(parents=True, exist_ok=True) |
| 1214 | self.mkdir(mode, parents=False, exist_ok=exist_ok) |
| 1215 | except OSError: |
| 1216 | # Cannot rely on checking for EEXIST, since the operating system |
| 1217 | # could give priority to other errors like EACCES or EROFS |
| 1218 | if not exist_ok or not self.is_dir(): |
| 1219 | raise |
| 1220 | |
| 1221 | def chmod(self, mode, *, follow_symlinks=True): |
| 1222 | """ |
no test coverage detected