ArmNN
 21.08
armnnUtils::Filesystem Namespace Reference

Functions

fs::path NamedTempFile (const char *fileName)
 Returns a path to a file in the system temporary folder. If the file existed it will be deleted. More...
 

Function Documentation

◆ NamedTempFile()

fs::path NamedTempFile ( const char *  fileName)

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

Construct a temporary file name.

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 TEST_CASE_FIXTURE(), and TEST_SUITE().

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 }