MCPcopy Create free account
hub / github.com/F-Stack/f-stack / fopen_orDie

Function fopen_orDie

freebsd/contrib/zstd/examples/common.h:99–106  ·  view source on GitHub ↗

! fopen_orDie() : * Open a file using given file path and open option. * * @return If successful this function will return a FILE pointer to an * opened file otherwise it sends an error to stderr and exits. */

Source from the content-addressed store, hash-verified

97 * opened file otherwise it sends an error to stderr and exits.
98 */
99static FILE* fopen_orDie(const char *filename, const char *instruction)
100{
101 FILE* const inFile = fopen(filename, instruction);
102 if (inFile) return inFile;
103 /* error */
104 perror(filename);
105 exit(ERROR_fopen);
106}
107
108/*! fclose_orDie() :
109 * Close an opened file using given FILE pointer.

Callers 6

compressFile_orDieFunction · 0.85
compressFile_orDieFunction · 0.85
compressFile_orDieFunction · 0.85
loadFile_orDieFunction · 0.85
saveFile_orDieFunction · 0.85
decompressFile_orDieFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected