 
         if (stat("dir-dog", &st) == -1) {
             mkdir("dir-dog", 0700);
+        }
+
+        if (stat("dir-dog-txt", &st) == -1) {
+            mkdir("dir-dog-txt", 0700);
         }
 
         float* array;


void Pyramid::Octave::download_and_save_array( const char* basename, uint32_t octave, uint32_t level )
{
    if( level >= _levels ) {
        cerr << "Level " << level << " does not exist in Octave " << octave << endl;
        return;


            ostringstream ostr;
            ostr << "dir-dog/d-" << basename << "-o-" << octave << "-l-" << l << ".pgm";
            // cerr << "Writing " << ostr.str() << endl;
            popart::write_plane2D( ostr.str().c_str(), true, p );

            ostringstream ostr2;
            ostr2 << "dir-dog-txt/d-" << basename << "-o-" << octave << "-l-" << l << ".txt";
            popart::write_plane2Dunscaled( ostr2.str().c_str(), true, p );
        }

