SplitFiles.cpp File Reference
#include <string>
#include <iomanip>
#include <iostream>
#include <fstream>
#include <sstream>
#include <sys/stat.h>
#include <cstdio>
#include <cstdlib>
#include <Logger.h>

Classes

class  CFile
 takes data and fstat files and splits them into *.data.???? and *.fstat.???? files More...
 

Functions

int main (int argc, char *argv[])
 

Function Documentation

◆ main()

int main ( int argc  ,
char argv[] 
)
199 {
200  if (argc<2) {
201  logger(WARN, "split_files problem_name [stepsize [initial_counter]]");
202  return -1;
203  }
204  std::string name(argv[1]);
205  logger(INFO, "Name: %", name);
206 
207  unsigned int stepsize = 1;
208  if (argc > 2) stepsize = static_cast<unsigned int>(atoi(argv[2]));
209 
210  //defines the initial counter
211  unsigned int counter = 0;
212  if (argc > 3) counter = static_cast<unsigned int>(atoi(argv[3]));
213 
214  CFile files(name);
215  files.copy(stepsize, counter);
216  logger(INFO, "finished writing split files: %", name);
217  return 0;
218 }
LL< Log::INFO > INFO
Info log level.
Definition: Logger.cc:55
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
LL< Log::WARN > WARN
Warning log level.
Definition: Logger.cc:54
takes data and fstat files and splits them into *.data.???? and *.fstat.???? files
Definition: centerofmass.cpp:40
std::string name
Definition: MercuryProb.h:48

References CFile::copy(), INFO, logger, units::name, and WARN.