#include <ostream>
 #include <fstream>
+#include <map>
 
 using namespace std;
  
 {
  public:
   writeout(const string& wdir, const string& signature, 
-          const int& rank, const int& procs, const long& timestamp=0);
-  ostream *out;
+          const int& rank, const int& procs);
+  void newsub(string subname);
+  map<string,ostream*> out;
   ostream *log;
   ~writeout();
 
  private:
-  ofstream of;
+  map<string,ofstream*> of;
+  map<string,streambuf*> buf;
   ofstream logf;
-  streambuf *buf;
   streambuf *logbuf;
   string fulldir;
   char cRank[20];
-  string tstamp(const long& timestamp);
+  int rank;
   int numprocs;
-  string getdatfile();
+  string getdatfile(string subname);
   string timestring();
-  static bool DirectoryExists(const char* pzPath);
+  string signature;
+  static string longToStr (long arg);
 };
 
 #endif