Wireshark  2.9.0-477-g68ec514b
The Wireshark network protocol analyzer
Functions
tempfile.h File Reference
#include "ws_symbol_export.h"

Go to the source code of this file.

Functions

WS_DLL_PUBLIC char * get_tempfile_path (const char *filename)
 
WS_DLL_PUBLIC int create_tempfile (char **namebuf, const char *pfx, const char *sfx)
 

Detailed Description

Convenience function for temporary file creation.

Function Documentation

WS_DLL_PUBLIC int create_tempfile ( char **  namebuf,
const char *  pfx,
const char *  sfx 
)

Create a tempfile with the given prefix (e.g. "wireshark"). The path is created using g_get_tmp_dir and mkstemp.

Parameters
namebuf[in,out] If not NULL, receives the full path of the temp file. Must NOT be freed.
pfx[in] A prefix for the temporary file.
sfx[in] A file extension for the temporary file. NULL can be passed if no file extension is needed
Returns
The file descriptor of the new tempfile, from mkstemps().

Create a tempfile with the given prefix (e.g. "wireshark").

Parameters
namebufIf not NULL, receives the full path of the temp file. Should NOT be freed.
pfxA prefix for the temporary file.
sfx[in] A file extension for the temporary file. NULL can be passed if no file extension is needed
Returns
The file descriptor of the new tempfile, from mkstemps().
WS_DLL_PUBLIC char* get_tempfile_path ( const char *  filename)

Construct the path name of a file in the appropriate temporary file directory.

Parameters
filenamethe file name to be given to the file.
Returns
the pathname of the file, g_malloced so the caller should g_free it.