mirror of
				https://github.com/davidgiven/fluxengine.git
				synced 2025-10-24 11:11:02 -07:00 
			
		
		
		
	Add a helper function for checking if a file exists.
This commit is contained in:
		| @@ -3,6 +3,7 @@ | ||||
| #include "lib/bytes.h" | ||||
| #include <fmt/format.h> | ||||
| #include <iomanip> | ||||
| #include <fstream> | ||||
|  | ||||
| bool emergencyStop = false; | ||||
|  | ||||
| @@ -190,3 +191,10 @@ std::string tohex(const std::string& s) | ||||
|  | ||||
|     return ss.str(); | ||||
| } | ||||
|  | ||||
| bool doesFileExist(const std::string& filename) | ||||
| { | ||||
| 	std::ifstream f(filename); | ||||
| 	return f.good(); | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -18,6 +18,7 @@ extern std::string toIso8601(time_t t); | ||||
| extern std::string quote(const std::string& s); | ||||
| extern std::string unhex(const std::string& s); | ||||
| extern std::string tohex(const std::string& s); | ||||
| extern bool doesFileExist(const std::string& filename); | ||||
|  | ||||
| /* If set, any running job will terminate as soon as possible (with an error). | ||||
|  */ | ||||
|   | ||||
		Reference in New Issue
	
	Block a user