0

How to get the name of the temporary file in Live Capture mode without use output_file?

capture = pyshark.LiveCapture(interface='any', only_summaries=True)
mohsen
  • 81
  • 1
  • 2
  • 6
  • This sounds like an [XY problem](https://xyproblem.info/). What do you intend to achieve using this? – pigrammer Oct 11 '22 at 14:09
  • I don't know much about pyshark, but `tshark` (tested with version 4.0.0 on Windows) outputs the name of the temporary capture file when it's run, so presumably pyshark could read and parse the message to find out the name of the temporary capture file. Alternatively, you may be able to discover the name of the temporary capture file by scanning the system's `TEMP` directory for the latest file of the form, `wiresharkXXXXXX.pcapng`. Note that there might be old, left-over temporary capture files present in the `TEMP` folder that weren't previously properly cleaned up. – Christopher Maynard Oct 12 '22 at 21:02
  • I want to build a software like wireshark with special purpose. – mohsen Oct 15 '22 at 04:57
  • Thank you very much, but this method does not work for me. – mohsen Oct 15 '22 at 04:59

0 Answers0