1 |
#include <iostream> |
#include <iostream> |
2 |
|
#include <iomanip> |
3 |
#include <sstream> |
#include <sstream> |
4 |
#include <string> |
#include <string> |
5 |
#include <vector> |
#include <vector> |
92 |
} |
} |
93 |
|
|
94 |
|
|
95 |
FILE* in = fopen( inputfile.c_str(), "r" ); |
FILE* in = fopen64( inputfile.c_str(), "r" ); |
96 |
FILE* out = NULL; |
FILE* out = NULL; |
97 |
//ifstream in( inputfile.c_str() ); |
//ifstream in( inputfile.c_str() ); |
98 |
//ofstream out; |
//ofstream out; |
101 |
|
|
102 |
if ( in == NULL ) { |
if ( in == NULL ) { |
103 |
cout << "Could not open " << argv[1] << endl; |
cout << "Could not open " << argv[1] << endl; |
104 |
|
perror(""); |
105 |
return 2; |
return 2; |
106 |
} |
} |
107 |
|
|
137 |
bool did_exist = boost::filesystem::exists(filename); |
bool did_exist = boost::filesystem::exists(filename); |
138 |
|
|
139 |
//out.open( filename.c_str(), ios::app ); |
//out.open( filename.c_str(), ios::app ); |
140 |
out = fopen(filename.c_str(), "a"); |
out = fopen64(filename.c_str(), "a"); |
141 |
|
|
142 |
|
|
143 |
|
|
156 |
|
|
157 |
if (out != NULL ) { |
if (out != NULL ) { |
158 |
fputs(linebuf, out); |
fputs(linebuf, out); |
159 |
fputs("\n", out); |
//fputs("\n", out); |
160 |
//out << linebuf << endl; |
//out << linebuf << endl; |
161 |
} else { |
} else { |
162 |
header << linebuf << endl; //collect preamble for later use |
header << linebuf; //collect preamble for later use |
163 |
} |
} |
164 |
|
|
165 |
} |
} |
173 |
|
|
174 |
time_t end = time(NULL); |
time_t end = time(NULL); |
175 |
|
|
176 |
cout << "Elapsed " << (end-start) << " seconds" << endl; |
|
177 |
|
time_t elapsed = end-start; |
178 |
|
cout << setfill('0') << "Elapsed time " << elapsed/60 << ":" << setw(2) << elapsed%60 << endl; |
179 |
|
|
180 |
fclose(in); |
fclose(in); |
181 |
} |
} |