#include "sclfuncs.h" 

using namespace scl;
using namespace std;

int main(int argc, char** argp, char** envp)
{

  cout << boolalpha << '\n';

  string cwd;
  bool rv = getCurrentWorkingDirectory(cwd) << '\n';
  cout << cwd << '\n';
  cout << rv << '\n';
  cout << '\n';

  string filename;
  mode_t perm;
  bool valid_perm;

  filename = "whatever";
  cout << filename << '\n';
  cout << isDirectory(filename.c_str()) << '\n';
  cout << isRegularFile(filename.c_str()) << '\n';
  cout << (valid_perm = getPermissions(filename.c_str(),perm));
  if (valid_perm) cout << ' ' << perm << '\n';
  cout << '\n';

  filename = "tstfutil.cpp";
  cout << filename << '\n';
  cout << isDirectory(filename.c_str()) << '\n';
  cout << isRegularFile(filename.c_str()) << '\n';
  cout << (valid_perm = getPermissions(filename.c_str(),perm));
  if (valid_perm) cout << ' ' << perm << '\n';
  cout << '\n';

  filename = "/usr/local/lib";
  cout << filename << '\n';
  cout << isDirectory(filename.c_str()) << '\n';
  cout << isRegularFile(filename.c_str()) << '\n';
  cout << (valid_perm = getPermissions(filename.c_str(),perm));
  if (valid_perm) cout << ' ' << perm << '\n';
  cout << '\n';

  return 0;
}
