filesys test reviewed

This commit is contained in:
James Turk 2005-07-20 01:43:57 +00:00
parent 2c1d1de266
commit 72117b5314

View File

@ -5,7 +5,7 @@
// James Turk (jpt2433@rit.edu) // James Turk (jpt2433@rit.edu)
// //
// Version: // Version:
// $Id: filesys_test.cpp,v 1.2 2005/07/06 02:10:07 cozman Exp $ // $Id: filesys_test.cpp,v 1.3 2005/07/20 01:43:57 cozman Exp $
#include "photon.hpp" #include "photon.hpp"
#include <iostream> #include <iostream>
@ -14,6 +14,8 @@ using namespace std;
using namespace photon; using namespace photon;
using namespace photon::util; using namespace photon::util;
// Basic test of util::filesys functionality, simply outputs essentially
// all information available via util::filesys.
class FilesysTest : public Application class FilesysTest : public Application
{ {
public: public:
@ -59,14 +61,20 @@ public:
} }
cout << endl; cout << endl;
cout << "filesys_test.cpp" << (filesys::exists("filesys_test.cpp") ? " exists" : " not found") << endl; cout << "filesys_test.cpp"
cout << "wokka " << (filesys::exists("wokka") ? " exists" : " not found") << endl; << (filesys::exists("filesys_test.cpp") ? " exists" : " not found")
<< endl;
cout << "wokka "
<< (filesys::exists("wokka") ? " exists" : " not found") << endl;
cout << "making directory 'bam'" << endl; cout << "making directory 'bam'" << endl;
filesys::mkdir("bam"); filesys::mkdir("bam");
cout << "bam " << (filesys::isDir("bam") ? " is dir" : " not dir") << endl; cout << "bam " << (filesys::isDir("bam") ? " is dir" : " not dir")
cout << "filesys_test.cpp" << (filesys::isDir("filesys_test.cpp") ? " is dir" : " not dir") << endl; << endl;
cout << "filesys_test.cpp"
<< (filesys::isDir("filesys_test.cpp") ? " is dir" : " not dir")
<< endl;
filesys::remove("bam"); filesys::remove("bam");
cout << "removing directory 'bam'" << endl; cout << "removing directory 'bam'" << endl;
@ -74,7 +82,8 @@ public:
//other //other
cout << "Dir separator: " << filesys::getDirSeparator() << endl; cout << "Dir separator: " << filesys::getDirSeparator() << endl;
cout << "Mod time of filesys_test.cpp" ": " << filesys::getModTime("filesys_test.cpp") << endl; cout << "Mod time of filesys_test.cpp" ": "
<< filesys::getModTime("filesys_test.cpp") << endl;
// search path redux // search path redux