MCPcopy Index your code
hub / github.com/RustPython/RustPython / clean

Method clean

Lib/mailbox.py:530–536  ·  view source on GitHub ↗

Delete old files in "tmp".

(self)

Source from the content-addressed store, hash-verified

528 os.rmdir(path)
529
530 def clean(self):
531 """Delete old files in "tmp"."""
532 now = time.time()
533 for entry in os.listdir(os.path.join(self._path, 'tmp')):
534 path = os.path.join(self._path, 'tmp', entry)
535 if now - os.path.getatime(path) > 129600: # 60 * 60 * 36
536 os.remove(path)
537
538 _count = 1 # This is used to generate unique file names.
539

Callers 1

test_cleanMethod · 0.80

Calls 4

listdirMethod · 0.80
timeMethod · 0.45
joinMethod · 0.45
removeMethod · 0.45

Tested by 1

test_cleanMethod · 0.64