ADMB Documentation  11.2.2817
 All Classes Files Functions Variables Typedefs Friends Defines
df1b2f17.cpp
Go to the documentation of this file.
00001 /*
00002  * $Id: df1b2f17.cpp 2491 2014-10-22 08:43:24Z johnoel $
00003  *
00004  * Author: David Fournier
00005  * Copyright (c) 2008-2012 Regents of the University of California
00006  */
00011 #include <df1b2fun.h>
00012 
00013 #ifndef _MSC_VER
00014   #include <unistd.h>
00015 #endif
00016 
00020 fixed_smartlist::~fixed_smartlist()
00021 {
00022   delete [] true_buffer;
00023   true_buffer=0;
00024   off_t pos=lseek(fp,0L,SEEK_END);
00025   int on1=-1;
00026   if ( (on1=option_match(ad_comm::argc,ad_comm::argv,"-fsize"))>-1)
00027   {
00028     if (ad_comm::global_logfile)
00029     {
00030       *ad_comm::global_logfile << "size of file " << filename
00031         << " = " << pos << endl;
00032     }
00033   }
00034   close(fp);
00035 #if defined (_MSC_VER)
00036   remove(filename);
00037 #else
00038   unlink(filename);
00039 #endif
00040 }
00041 
00046 fixed_smartlist2::~fixed_smartlist2()
00047 {
00048   delete [] true_buffer;
00049   true_buffer=0;
00050   off_t pos=lseek(fp,0L,SEEK_END);
00051   int on1=-1;
00052   if ( (on1=option_match(ad_comm::argc,ad_comm::argv,"-fsize"))>-1)
00053   {
00054     if (ad_comm::global_logfile)
00055     {
00056       *ad_comm::global_logfile << "size of file " << filename
00057         << " = " << pos << endl;
00058     }
00059   }
00060   close(fp);
00061 #if defined (_MSC_VER)
00062   remove(filename);
00063 #else
00064   unlink(filename);
00065 #endif
00066 }