ArmNN
 21.02
armnnUtils::Filesystem Namespace Reference

Functions

fs::path NamedTempFile (const char *fileName)
 Construct a temporary file name. More...
 

Function Documentation

◆ NamedTempFile()

fs::path NamedTempFile ( const char *  fileName)

Construct a temporary file name.

Returns a path to a file in the system temporary folder. If the file existed it will be deleted.

Given a specified file name construct a path to that file in the system temporary directory. If the file already exists it is deleted. This could throw filesystem_error exceptions.

Parameters
fileNamethe file name required in the temporary directory.
Returns
path consisting of system temporary directory and file name.

Definition at line 23 of file Filesystem.cpp.

Referenced by BOOST_AUTO_TEST_CASE(), and BOOST_FIXTURE_TEST_CASE().

24 {
25  fs::path tmpDir = fs::temp_directory_path();
26  fs::path namedTempFile{tmpDir / fileName};
27  if (fs::exists(namedTempFile))
28  {
29  fs::remove(namedTempFile);
30  }
31  return namedTempFile;
32 }