MCPcopy Create free account
hub / github.com/twisted/twisted / remove

Method remove

src/twisted/python/filepath.py:1462–1474  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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 """

Callers 15

removeObserverMethod · 0.45
rotateMethod · 0.45
reflect.pyFile · 0.45
moveToMethod · 0.45
symlinkFunction · 0.45
rmlinkFunction · 0.45
_removeHookFunction · 0.45
assertStructureMethod · 0.45
test_removeMethod · 0.45
test_queryRemoveMethod · 0.45

Calls 4

isdirMethod · 0.95
islinkMethod · 0.95
changedMethod · 0.95
childrenMethod · 0.45