This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

How to change wireshark temp files' directory

0

I want to change wireshark ".pcapng" temp files' directory, how to config or where to modify the source code?

asked 20 Jan '14, 17:09

metamatrix's gravatar image

metamatrix
56161619
accept rate: 100%


One Answer:

1

Presumably you mean the directory in which it writes temporary capture files.

On UN*X, you can set the TMPDIR environment variable to the directory you want the temporary files (which may be difficult if you're launching it from the GUI rather than the command line); on Windows, you can set the TEMP environment variable.

answered 20 Jan '14, 17:39

Guy%20Harris's gravatar image

Guy Harris ♦♦
17.4k335196
accept rate: 19%

I need only wireshark temp files to write in user config directory, without modifying the system temp directory. How to do?

(20 Jan '14, 21:09) metamatrix

Modify the source code by changing the create_tempfile() routine to use a different directory.

(20 Jan '14, 23:42) Guy Harris ♦♦

Just create a batch file that sets "temp" to whatever you need and runs Wireshark afterwards. That will get you a temporary "temp" path that will be discarded as soon as Wireshark exits. Much easier than a code change :)

(21 Jan '14, 01:15) Jasper ♦♦