Elaboradar 0.1
|
◆ write_vpr0()
Write in $VPR0_FILE the vpr calculated.
Definizione alla linea 437 del file assets.cpp. 438{
439 const char* fname = getenv("VPR0_FILE");
440 if (!fname) throw runtime_error("$VPR0_FILE (ultimo vpr) is not set");
442 for (unsigned i = 0; i < vpr.size(); ++i)
443 if (fprintf(out, " %10.3f %li\n", vpr.val[i], vpr.area[i]) < 0)
444 {
445 LOG_ERROR("$VPR0_FILE=%s cannot be written: %s", fname, strerror(errno));
446 fclose(out);
447 throw std::runtime_error("cannot write to $VPR0_FILE");
448 }
449 fclose(out);
450}
FILE * fopen_checked(const char *fname, const char *mode, const char *description) A wrapper of fopen that throws an exception if it cannot open the file. Definition utils.cpp:144 Referenzia radarelab::fopen_checked(). |