Removes the file or directory that is represented by self. If C{self.path} is a directory, recursively remove all its children before removing the directory. If it's a file or link, just delete it.
(self)
| 1460 | utime(self.path, None) |
| 1461 | |
| 1462 | def remove(self) -> None: |
| 1463 | """ |
| 1464 | Removes the file or directory that is represented by self. If |
| 1465 | C{self.path} is a directory, recursively remove all its children |
| 1466 | before removing the directory. If it's a file or link, just delete it. |
| 1467 | """ |
| 1468 | if self.isdir() and not self.islink(): |
| 1469 | for child in self.children(): |
| 1470 | child.remove() |
| 1471 | os.rmdir(self.path) |
| 1472 | else: |
| 1473 | os.remove(self.path) |
| 1474 | self.changed() |
| 1475 | |
| 1476 | def makedirs(self, ignoreExistingDirectory: bool = False) -> None: |
| 1477 | """ |