#include #include #include "util/tempfile.h" using namespace std; int main(int argc, char *argv[]){ cerr << "Usage: " << argv[0] << endl; try{ TempFile temp; cout << "fname:" << temp.get_fname() << endl; cout << "path:" << temp.get_path() << endl; iostream &ios(temp.stream()); ios << "hoge ada basha" << endl; string cmd; cmd.append("cat ").append(temp.get_fname()); cout << cmd << endl; cout << ((system(cmd.c_str()) >= 0) ? "OK" : "NG") << endl; }catch(exception &e){ cerr << e.what() << endl; } return 0; }