#include #include #include #include "JSystem/JStat.hh" #include "Jeep/JParser.hh" #include "Jeep/JMessage.hh" /** * \file * * Example program to print status of file. * \author mdejong */ int main(int argc, char* argv[]) { using namespace std; string file_name; try { JParser<> zap("Example program to print status of file."); zap['f'] = make_field(file_name) = argv[0]; zap(argc, argv); } catch(const exception &error) { FATAL(error.what() << endl); } using namespace JPP; const JStat jas(file_name.c_str()); if (jas.getError() == 0) { cout << "UID " << jas.getUID() << endl; cout << "GID " << jas.getGID() << endl; cout << "Size [B] " << jas.getSize() << endl; cout << "Last access " << jas.getTimeOfLastAccess() << endl; cout << "Last modified " << jas.getTimeOfLastModification() << endl; cout << "Last changed " << jas.getTimeOfLastChange() << endl; } else { cout << "error: " << file_name << std::endl; } }