ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
df1b2f17.cpp
Go to the documentation of this file.
1 /*
2  * $Id$
3  *
4  * Author: David Fournier
5  * Copyright (c) 2008-2012 Regents of the University of California
6  */
11 #include <df1b2fun.h>
12 
13 #ifndef _MSC_VER
14  #include <unistd.h>
15 #endif
16 
20 {
21  if (true_buffer)
22  {
23  delete [] true_buffer;
24  true_buffer = NULL;
25  }
26  int on1 = -1;
27  if ((on1 = option_match(ad_comm::argc, ad_comm::argv, "-fsize")) > -1)
28  {
30  {
31  off_t pos = lseek(fp, 0L, SEEK_END);
32  *ad_comm::global_logfile << "size of file " << filename
33  << " = " << pos << endl;
34  }
35  }
36  close(fp);
37 #if defined (_MSC_VER)
38  remove(filename);
39 #else
40  unlink(filename);
41 #endif
42 }
47 {
48  if (true_buffer)
49  {
50  delete [] true_buffer;
51  true_buffer = NULL;
52  }
53  int on1 = -1;
54  if ((on1 = option_match(ad_comm::argc, ad_comm::argv, "-fsize")) > -1)
55  {
57  {
58  off_t pos = lseek(fp, 0L, SEEK_END);
59  *ad_comm::global_logfile << "size of file " << filename
60  << " = " << pos << endl;
61  }
62  }
63  close(fp);
64 #if defined (_MSC_VER)
65  remove(filename);
66 #else
67  unlink(filename);
68 #endif
69 }
~fixed_smartlist()
Destructor.
Definition: df1b2f17.cpp:19
static ofstream * global_logfile
Definition: fvar.hpp:8858
static char ** argv
Definition: fvar.hpp:8866
~fixed_smartlist2()
Destructor.
Definition: df1b2f17.cpp:46
prnstream & endl(prnstream &)
static int argc
Definition: fvar.hpp:8863
int * true_buffer
Definition: df1b2fun.h:688
fixed_list_entry * true_buffer
Definition: df1b2fun.h:621
int option_match(int argc, char *argv[], const char *string)
Checks if the program has been invoked with a particular command line argument (&quot;string&quot;).
Definition: optmatch.cpp:25
size_t pos(const adstring &substr, const adstring &s)
Definition: string3.cpp:56
Description not yet available.
adstring filename
Definition: df1b2fun.h:696
adstring filename
Definition: df1b2fun.h:629