#include <iostream>
#include <fstream>
#include <string>
#include <time.h>
using namespace std;
const string currentDateTime();
int main(int argc,char *argv[])
{
//printf("argc = %d \n",argc);
//printf("argv[0] = %s \n",argv[0]);
ifstream myFile;
string line;
if(argc == 2)
{
//print start read time
cout<< "================================================\n";
cout<< "Start Read : "<< currentDateTime() <<endl;
cout<< "================================================\n";
myFile.open(argv[1]);
//myFile.open("test.txt");
while(!myFile.eof())
{
//myFile>>line;
getline(myFile,line);
//cout<< line <<endl;
}
myFile.close();
//print end read time
cout<< "================================================\n";
cout<< "End Read : "<< currentDateTime() <<endl;
cout<< "================================================\n";
}
return 0;
}
const string currentDateTime()
{
time_t now = time(0);
struct tm tstruct;
char buf[80];
tstruct = *localtime(&now);
strftime(buf, sizeof(buf), "%d/%m/%Y %X", &tstruct);
return buf;
}