c4_FileStrategy::~c4_FileStrategy() { _file = 0; ResetFileMapping(); if (_cleanup) { fclose(_cleanup); } d4_assert(_mapStart == 0); FinalizeIO(); }
/** Redirect output to file. If no name given assume STDOUT. */ int OutputToFile(const char* fname) { FinalizeIO(); if (fname != 0) { mprintf("Info: Redirecting output to file '%s'\n", fname); STDOUT_ = fopen(fname, "wb"); if (STDOUT_ == 0) { loudPrinterr("Error: Could not open output file '%s'\n", fname); return 1; } } return 0; }