Delete old pcap file when starting a new packet capture.

pull/1316/head
grossmj 6 years ago
parent 233e41d006
commit 38f458db7c

@ -305,6 +305,12 @@ class Link:
Dump a pcap file on disk
"""
if os.path.exists(self.capture_file_path):
try:
os.remove(self.capture_file_path)
except OSError as e:
raise aiohttp.web.HTTPConflict(text="Could not delete old capture file '{}': {}".format(self.capture_file_path, e))
try:
stream_content = yield from self.read_pcap_from_source()
except aiohttp.web.HTTPException as e:

Loading…
Cancel
Save