* open_file * * Open a file for reading or writing. If the file name parameter is * NULL use stdin (or stdout) for the file. If the file can not be * opened then call the error routine. **********************************************************************/
| 80 | * opened then call the error routine. |
| 81 | **********************************************************************/ |
| 82 | FILE *open_file(const char *filename, const char *mode) { |
| 83 | FILE *thisfile = NULL; |
| 84 | if ((thisfile = fopen (filename, mode)) == NULL) { |
| 85 | tprintf ("Could not open file, %s\n", filename); |
| 86 | exit (1); |
| 87 | } |
| 88 | return (thisfile); |
| 89 | } |
| 90 | |
| 91 | /// Check whether the file exists |
| 92 | bool exists_file(const char *filename) { |
no outgoing calls
no test coverage detected