MCPcopy Index your code
hub / github.com/python/cpython / clean

Method clean

Lib/mailbox.py:537–543  ·  view source on GitHub ↗

Delete old files in "tmp".

(self)

Source from the content-addressed store, hash-verified

535 os.rmdir(path)
536
537 def clean(self):
538 """Delete old files in "tmp"."""
539 now = time.time()
540 for entry in os.listdir(os.path.join(self._path, 'tmp')):
541 path = os.path.join(self._path, 'tmp', entry)
542 if now - os.path.getatime(path) > 129600: # 60 * 60 * 36
543 os.remove(path)
544
545 _count = 1 # This is used to generate unique file names.
546

Callers 2

bFunction · 0.80
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