ADMB Documentation  11.5.3197
 All Classes Files Functions Variables Typedefs Friends Defines
df1b2f17.cpp
Go to the documentation of this file.
00001 /*
00002  * $Id$
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 
00019 fixed_smartlist::~fixed_smartlist()
00020 {
00021   if (true_buffer)
00022   {
00023     delete [] true_buffer;
00024     true_buffer = NULL;
00025   }
00026   int on1 = -1;
00027   if ((on1 = option_match(ad_comm::argc, ad_comm::argv, "-fsize")) > -1)
00028   {
00029     if (ad_comm::global_logfile)
00030     {
00031       off_t pos = lseek(fp, 0L, SEEK_END);
00032       *ad_comm::global_logfile << "size of file " << filename
00033         << " = " << pos << endl;
00034     }
00035   }
00036   close(fp);
00037 #if defined (_MSC_VER)
00038   remove(filename);
00039 #else
00040   unlink(filename);
00041 #endif
00042 }
00046 fixed_smartlist2::~fixed_smartlist2()
00047 {
00048   if (true_buffer)
00049   {
00050     delete [] true_buffer;
00051     true_buffer = NULL;
00052   }
00053   int on1 = -1;
00054   if ((on1 = option_match(ad_comm::argc, ad_comm::argv, "-fsize")) > -1)
00055   {
00056     if (ad_comm::global_logfile)
00057     {
00058       off_t pos = lseek(fp, 0L, SEEK_END);
00059       *ad_comm::global_logfile << "size of file " << filename
00060         << " = " << pos << endl;
00061     }
00062   }
00063   close(fp);
00064 #if defined (_MSC_VER)
00065   remove(filename);
00066 #else
00067   unlink(filename);
00068 #endif
00069 }