MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / clean

Method clean

tools/python-3.11.9-amd64/Lib/mailbox.py:480–486  ·  view source on GitHub ↗

Delete old files in "tmp".

(self)

Source from the content-addressed store, hash-verified

478 os.rmdir(path)
479
480 def clean(self):
481 """Delete old files in "tmp"."""
482 now = time.time()
483 for entry in os.listdir(os.path.join(self._path, 'tmp')):
484 path = os.path.join(self._path, 'tmp', entry)
485 if now - os.path.getatime(path) > 129600: # 60 * 60 * 36
486 os.remove(path)
487
488 _count = 1 # This is used to generate unique file names.
489

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected