vg
tools for working with variation graphs
Classes | Functions
vg::temp_file Namespace Reference

Classes

struct  Handler
 

Functions

string create (const string &base)
 Create a temporary file starting with the given base name. More...
 
string create ()
 Create a temporary file. More...
 
string create_directory ()
 Create a temporary directory. More...
 
void remove (const string &filename)
 
void forget ()
 Forget about all current temporary files and directories without deleting them. More...
 
void set_system_dir ()
 
void set_dir (const string &new_temp_dir)
 
string get_dir ()
 Get the current location for temporary files and directories. More...
 

Detailed Description

Temporary files and directories. Create with create() or create_directory() and remove with remove(). All temporary files and directories will be deleted when the program exits normally or with std::exit(). The files will be created in a directory determined from environment variables, though this can be overridden with set_dir(). The interface is thread-safe.

The temporary directory will be propagated to submodules (gbwt, gcsa2, xg).

Function Documentation

◆ create() [1/2]

string vg::temp_file::create ( )

Create a temporary file.

◆ create() [2/2]

string vg::temp_file::create ( const string &  base)

Create a temporary file starting with the given base name.

◆ create_directory()

string vg::temp_file::create_directory ( )

Create a temporary directory.

◆ forget()

void vg::temp_file::forget ( )

Forget about all current temporary files and directories without deleting them.

◆ get_dir()

string vg::temp_file::get_dir ( )

Get the current location for temporary files and directories.

◆ remove()

void vg::temp_file::remove ( const string &  filename)

Remove a temporary file or directory. File or directory must have been created by create() or create_directory() and not any other means.

◆ set_dir()

void vg::temp_file::set_dir ( const string &  new_temp_dir)

Set a directory for placing temporary files and directories in, overriding system defaults and environment variables.

◆ set_system_dir()

void vg::temp_file::set_system_dir ( )

Reset the temporary directory back to the default based on environment variables and system defaults.