5 #if !defined(ARMNN_DISABLE_FILESYSTEM)
27 fs::path tmpDir = fs::temp_directory_path();
28 fs::path namedTempFile{tmpDir / fileName};
29 if (fs::exists(namedTempFile))
31 fs::remove(namedTempFile);
50 fs::path tmpDir = fs::temp_directory_path();
51 std::string full_path = tmpDir.generic_string() + path;
55 result = _mkdir(full_path.c_str());
56 armnn::ConditionalThrow<armnn::RuntimeException>((result == 0),
"Was unable to create temporary directory");
60 if(!fs::create_directory(full_path))
65 catch (
const std::system_error& e)
67 std::string
error =
"Unable to create directory. Reason: ";
68 error.append(e.what());
73 return full_path +
"/";
93 catch (
const std::system_error& e)
95 std::string
error =
"Directory exists and cannot be removed. Reason: ";
96 error.append(e.what());
103 if (!fs::exists(path))
107 std::ifstream input_file(path);
108 armnn::ConditionalThrow<armnn::RuntimeException>((input_file.is_open()),
"Could not read file contents");
109 return FileContents((std::istreambuf_iterator<char>(input_file)), std::istreambuf_iterator<char>());
115 #endif // !defined(ARMNN_DISABLE_FILESYSTEM)