MCPcopy Create free account
hub / github.com/FastFlowLM/FastFlowLM / check_arg_file_exists

Function check_arg_file_exists

src/include/utils/utils.hpp:198–209  ·  view source on GitHub ↗

\brief check if the file exists \param name the name of the file

Source from the content-addressed store, hash-verified

196/// \brief check if the file exists
197/// \param name the name of the file
198inline void check_arg_file_exists(std::string name) {
199 // Attempt to open the file
200 std::ifstream file(name);
201
202 // Check if the file was successfully opened
203 if (!file) {
204 throw std::runtime_error("Error: File '" + name + "' does not exist or cannot be opened.");
205 }
206
207 // Optionally, close the file (not strictly necessary, as ifstream will close on destruction)
208 file.close();
209}
210
211
212/// \brief print the npu profile

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected