Commit 14c81e5f authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

check if the input file exists

parent d9e4a654
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -469,6 +469,12 @@ int main(int argc, char * argv[])
		return EXIT_SUCCESS;
	}

	// check if the input file exists
	if (!std::filesystem::exists(input_file)) {
		std::cerr << "Error: input_file \"" + input_file.string() + "\" does not exist." << std::endl;
		return EXIT_FAILURE;
	}

	// check if the output directory exists
	if (!std::filesystem::is_directory(output_dir)) {
		std::cerr << "Error: output_dir \"" + output_dir.string() + "\" is not an existing directory." << std::endl;