Index: /trunk/src/print_s70_data.cc
===================================================================
--- /trunk/src/print_s70_data.cc	(revision 83)
+++ /trunk/src/print_s70_data.cc	(revision 84)
@@ -16,5 +16,5 @@
  TEL_AZ, STATUS, TPOWER, NBLK_READ, SCAN_RATEL, SCAN_RATEB, BYTE_GRP, IBEAM, PSRNAME, DATA_TWO, OBS_FILEN, NBITS, DDM, NDDCH, MOVE, PNTERR, TREE, NSYS, TELID, NBEAM, RESERVE};
 
-const string fieldName[RESERVE+1] = 
+const std::string fieldName[RESERVE+1] = 
 {"SYNCH", "VERSION", "TAPENR", "SCAN_CNTR", "BLK_CNTR", "DATE", "MJD", "UT_STRT", "LST_STRT", "COORD_TYPE",
  "RA_STRT", "DEC_STRT", "GL_STRT", "GB_STRT", "SCAN_RATE", "SCAN_LEN", "COMMENT", "NFILTER", "CHANBW", "NCHAN", "FREQ_CHAN1",
@@ -35,5 +35,5 @@
 int fieldStartLoc[RESERVE+1];
 
-inline string getSub(string hdr, int field){
+inline std::string getSub(std::string hdr, int field){
   return hdr.substr(fieldStartLoc[field],totalFieldSize[field]);
 };
@@ -57,6 +57,6 @@
    */
 
-  ifstream fin;
-  string filename;
+  std::ifstream fin;
+  std::string filename;
   if(argc==1){
     filename = "data/s70_tape_test_S181_S18101.dat";
@@ -66,5 +66,5 @@
   }
   else{
-    cerr << "Either \"s70.x\" or \"s70.x filename\"...\n";
+    std::cerr << "Either \"s70.x\" or \"s70.x filename\"...\n";
     return(1);
   }
@@ -77,5 +77,5 @@
   for(int i=1;i<=RESERVE;i++) fieldStartLoc[i] = fieldStartLoc[i-1] + totalFieldSize[i-1];
 
-  fin.open(filename.c_str(),ios::binary);
+  fin.open(filename.c_str(),std::ios::binary);
   if(!fin.good()){
     std::cerr << "Cannot find file " << filename << "!\nExiting...\n";
@@ -92,9 +92,9 @@
   fin.close();
 
-  fin.open(filename.c_str(),ios::binary);
+  fin.open(filename.c_str(),std::ios::binary);
   // define and read in the header
   hdr = new char[HDR_LENGTH];
   fin.read( hdr, HDR_LENGTH*sizeof(char) );
-  string originalHDR(" ",HDR_LENGTH);
+  std::string originalHDR(" ",HDR_LENGTH);
   for(int c=0;c<HDR_LENGTH;c++) originalHDR[c] = hdr[c];
 
@@ -106,6 +106,6 @@
   std::cout << "Header parsing:\n";
   for(int i=0; i<=RESERVE; i++){
-    std::cout << setw(10) << fieldName[i] << " ";
-    std::cout << "[" << setw(3) << fieldStartLoc[i] << "]:\t";
+    std::cout << std::setw(10) << fieldName[i] << " ";
+    std::cout << "[" << std::setw(3) << fieldStartLoc[i] << "]:\t";
     if(getSub(originalHDR,i)[0]!=0) std::cout << getSub(originalHDR,i);
     std::cout << "\n";
@@ -113,11 +113,11 @@
 
 
-  fin.open(filename.c_str(),ios::binary);
+  fin.open(filename.c_str(),std::ios::binary);
   // now try and read in the data
   char newone;
   
-  string fullstring(" ",HDR_LENGTH), oldtime = "bob",time,oldmove="44",move;
+  std::string fullstring(" ",HDR_LENGTH), oldtime = "bob",time,oldmove="44",move;
 
-  cerr.setf(ios::fixed);
+  std::cerr.setf(std::ios::fixed);
 
   while(!fin.read( hdr, HDR_LENGTH*sizeof(char) ).eof()){
@@ -128,5 +128,5 @@
     float samp_int = atof( getSub(fullstring,SAMP_INT).c_str() );
     int samp_grp = atoi( getSub(fullstring,SAMP_GRP).c_str() );
-    stringstream ss;
+    std::stringstream ss;
     ss.str(getSub(fullstring,NCHAN));
     int nch[2];
@@ -134,30 +134,31 @@
     move = atoi( getSub(fullstring,MOVE).c_str() );
 
-    string newUT = decToDMS( dmsToDec(getSub(fullstring,UT_STRT)) + 
+    std::string newUT = decToDMS( dmsToDec(getSub(fullstring,UT_STRT)) + 
 			     (atoi(getSub(fullstring,BLK_CNTR).c_str())-1)
 			     *blk_sec/3600. );
 
-    cerr << setw(totalFieldSize[BLK_CNTR]) << getSub(fullstring,BLK_CNTR)
-	 << " "
-// 	 << setw(totalFieldSize[COMMENT])  << getSub(fullstring,COMMENT)
-	 << extractFieldID(fullstring) << " "
-	 << setw(totalFieldSize[DATE])     << getSub(fullstring,DATE)
-	 << setw(totalFieldSize[UT_STRT])  << getSub(fullstring,UT_STRT)
-	 << setw(totalFieldSize[UT])       << getSub(fullstring,UT)
-// 	 << setw(12)                       << newUT
-// 	 << setw(10) << setprecision(6)
-// 	 << (dmsToDec(getSub(fullstring,UT).c_str()) - dmsToDec(newUT))*3600.
-	 << setw(totalFieldSize[LST])      << getSub(fullstring,LST)
-	 << setw(totalFieldSize[RA_STRT])  << getSub(fullstring,RA_STRT)
-	 << setw(totalFieldSize[DEC_STRT]) << getSub(fullstring,DEC_STRT)
-	 << setw(totalFieldSize[RA])       << getSub(fullstring,RA)
-	 << setw(totalFieldSize[DEC])      << getSub(fullstring,DEC)
-	 << setw(totalFieldSize[MOVE])     << getSub(fullstring,MOVE)
-// 	 << setw(totalFieldSize[IBEAM])    << getSub(fullstring,IBEAM)
-// 	 << setw(totalFieldSize[BLK_SEC])  << getSub(fullstring,BLK_SEC)
-// 	 << setw(totalFieldSize[GRP_BLK])  << getSub(fullstring,GRP_BLK)
-// 	 << setw(totalFieldSize[SAMP_INT]) << getSub(fullstring,SAMP_INT)
-// 	 << setw(totalFieldSize[SAMP_GRP]) << getSub(fullstring,SAMP_GRP)
-	 << std::endl;
+    std::cerr << std::setw(totalFieldSize[BLK_CNTR]) << getSub(fullstring,BLK_CNTR)
+	      << " "
+      // 	 << setw(totalFieldSize[COMMENT])  << getSub(fullstring,COMMENT)
+	      << extractFieldID(fullstring) << " "
+	      << std::setw(totalFieldSize[DATE])     << getSub(fullstring,DATE)
+	      << std::setw(totalFieldSize[UT_STRT])  << getSub(fullstring,UT_STRT)
+	      << std::setw(totalFieldSize[UT])       << getSub(fullstring,UT)
+      // 	 << setw(12)                       << newUT
+      // 	 << setw(10) << setprecision(6)
+      // 	 << (dmsToDec(getSub(fullstring,UT).c_str()) - dmsToDec(newUT))*3600.
+	      << std::setw(totalFieldSize[LST])      << getSub(fullstring,LST)
+	      << std::setw(totalFieldSize[RA_STRT])  << getSub(fullstring,RA_STRT)
+	      << std::setw(totalFieldSize[DEC_STRT]) << getSub(fullstring,DEC_STRT)
+	      << std::setw(totalFieldSize[RA])       << getSub(fullstring,RA)
+	      << std::setw(totalFieldSize[DEC])      << getSub(fullstring,DEC)
+	      << std::setw(totalFieldSize[MOVE])     << getSub(fullstring,MOVE)
+	      << std::setw(totalFieldSize[SCAN_LEN]) << getSub(fullstring,SCAN_LEN)
+      // 	 << setw(totalFieldSize[IBEAM])    << getSub(fullstring,IBEAM)
+      // 	 << setw(totalFieldSize[BLK_SEC])  << getSub(fullstring,BLK_SEC)
+      // 	 << setw(totalFieldSize[GRP_BLK])  << getSub(fullstring,GRP_BLK)
+      // 	 << setw(totalFieldSize[SAMP_INT]) << getSub(fullstring,SAMP_INT)
+      // 	 << setw(totalFieldSize[SAMP_GRP]) << getSub(fullstring,SAMP_GRP)
+	      << std::endl;
     
     for(int i=0;i<DAT_LENGTH;i++) fin.read( &newone, sizeof(char) ); 
Index: /trunk/src/pvo-FITS-fileIO.cc
===================================================================
--- /trunk/src/pvo-FITS-fileIO.cc	(revision 83)
+++ /trunk/src/pvo-FITS-fileIO.cc	(revision 84)
@@ -452,5 +452,6 @@
       std::string stp_crd1 = deblank(block.getKeyword<std::string>(RA));
       std::string stp_crd2 = deblank(block.getKeyword<std::string>(DEC));
-      float scanlen        = block.Survey().getScanlen();
+//       float scanlen        = block.Survey().getScanlen();
+      float scanlen        = block.getKeyword<float>(SCAN_LEN);
       std::string fd_mode  = block.Survey().getFd_mode();
       float fa_req         = block.getKeyword<float>(FEED_ANGLE);
@@ -577,4 +578,5 @@
        * extension. This is just a row of today's date and what was entered
        * in the command line.
+       * /deprecated
        */
     
Index: /trunk/src/pvo-metadata.cc
===================================================================
--- /trunk/src/pvo-metadata.cc	(revision 83)
+++ /trunk/src/pvo-metadata.cc	(revision 84)
@@ -152,5 +152,5 @@
     
       theStream << std::setfill('-')  
-		<< std::setw(filenameSize+1+15+15+31+11+11) << "-";
+		<< std::setw(filenameSize+1+15+15+31+11+11+11) << "-";
       if(datalist[0].showSep()) theStream << std::setw(13) << "-";
 
@@ -161,4 +161,5 @@
 		<< std::setw(10)           << "BEAM FWHM" << " "
 		<< std::setw(10)           << "OBSFREQ"   << " "
+		<< std::setw(10)           << "SCANLEN"   << " "
 		<< std::setw(30)           << "DATE-OBS";
       if(datalist[0].showSep())
@@ -171,4 +172,5 @@
 		<< std::setw(10)           << "[deg]"     << " "
 		<< std::setw(10)           << "[MHz]"     << " "
+		<< std::setw(10)           << "[s]"       << " "
 		<< std::setw(30)           << "";
       if(datalist[0].showSep())
@@ -177,5 +179,5 @@
 
       theStream << std::setfill('-')  
-		<< std::setw(filenameSize+1+15+15+31+11+11) << "-";
+		<< std::setw(filenameSize+1+15+15+31+11+11+11) << "-";
       if(datalist[0].showSep()) theStream << std::setw(13) << "-";
       theStream << "\n"<< std::setfill(' ') ;
@@ -196,4 +198,5 @@
 		  << std::setw(10)           << floatToString(datalist[i].getBeamsize()) << " "
 		  << std::setw(10)           << floatToString(datalist[i].getObsfreq())  << " "
+		  << std::setw(10)           << floatToString(datalist[i].getScanlen())  << " "
 		  << std::setw(30)           << datalist[i].getDate();
 
Index: /trunk/src/pvo-utils.hh
===================================================================
--- /trunk/src/pvo-utils.hh	(revision 83)
+++ /trunk/src/pvo-utils.hh	(revision 84)
@@ -21,9 +21,12 @@
 "Usage: pvoconvert [options] <survey file(s)> ...\n\
   Options:\n\
-  -H        Use the PH (High Latitude) Survey settings, rather than those for the\n\
-  --highlat  PM/Multibeam Survey\n\
-  -h        Display this help page.\n\
+  -D <dir>          Run pvoconvert on all files in the stated directory.\n\
+  --directory <dir>\n\
+                     No <survey file> needs to be given in this case.\n\
+  -H                Use the PH (High Latitude) Survey settings, rather than\n\
+  --highlat          those for the PM/Multibeam Survey\n\
+  -h                Display this help page.\n\
   --help\n\
-  -v        Verbose mode for error/warning messages.\n\
+  -v                Verbose mode for error/warning messages.\n\
   --verbose\n\
 ---------\n\n\
@@ -39,9 +42,12 @@
 "Usage: pvoconvert [options] <survey file(s)>\n\
   Options:\n\
-  -H        Use the PH (High Latitude) Survey settings, rather than those for the\n\
-  --high      PM/Multibeam Survey\n\
-  -h        Display this help page.\n\
+  -D <dir>          Run pvoconvert on all files in the stated directory.\n\
+  --directory <dir>\n\
+                     No <survey file> needs to be given in this case.\n\
+  -H                Use the PH (High Latitude) Survey settings, rather than\n\
+  --highlat          those for the PM/Multibeam Survey\n\
+  -h                Display this help page.\n\
   --help\n\
-  -v        Verbose mode for error/warning messages.\n\
+  -v                Verbose mode for error/warning messages.\n\
   --verbose\n";
 
Index: /trunk/src/pvoconvert.cc
===================================================================
--- /trunk/src/pvoconvert.cc	(revision 83)
+++ /trunk/src/pvoconvert.cc	(revision 84)
@@ -6,4 +6,5 @@
 #include <unistd.h>
 #include <getopt.h>
+#include <glob.h>
 #include "pvo-block.hh"
 #include "pvo-header.hh"
@@ -35,4 +36,7 @@
    * The format of usage is: <br> 
    * <tt>> pvoconvert FILE </tt><br>
+   * Wildcards or multiple files are accepted. To run on all files in a
+   * directory, use the <tt>-D</tt> option:<br>
+   * <tt>> pvoconvert -D DIR </tt><br>
    * If the input FILE is from the Parkes High Latitude Multibeam
    * Survey (PH, Burgay et al. 2006), one needs to use the <tt>-H</tt>
@@ -51,4 +55,5 @@
   bool verbFlag = false;
   bool usingHighLatitude = false;
+  unsigned int i;
 
   if(argc==1){
@@ -57,6 +62,5 @@
   }
 
-  char c, digit_optind = 0;;
-  int optCount=0;
+  char c;
   while (true) {
     int option_index = 0;
@@ -64,11 +68,15 @@
       {"help", 0, 0, 'h'},
       {"highlat", 0, 0, 'H'},
+      {"directory", 1, 0, 'D'},
       {0, 0, 0, 0}
     };
 
-    c = getopt_long (argc, argv, "Hvh",
+    c = getopt_long (argc, argv, "D:Hvh",
 		     long_options, &option_index);
 
     if (c == -1) break;
+
+    std::string directory,filenames;
+    glob_t globbuf1,globbuf2;
 
     switch (c) {               
@@ -77,4 +85,15 @@
       // single letter equivalent
       break;
+    case 'D': // use all files in the specified directory.
+      directory = optarg;
+      globbuf1.gl_offs = 0;
+      globbuf2.gl_offs = 0;
+      filenames = directory + "/*";
+      glob(filenames.c_str(), GLOB_DOOFFS, NULL, &globbuf1);
+      namelist.resize(globbuf1.gl_pathc);
+      for(i=0;i<globbuf1.gl_pathc+globbuf1.gl_offs;i++) {
+	namelist[i] = globbuf1.gl_pathv[i];
+      }
+      break;
     case 'v': // use verbose mode
       verbFlag = true;
@@ -103,5 +122,5 @@
   }
 
-  for(int i=0; i<namelist.size(); i++){
+  for(i=0; i<namelist.size(); i++){
 
     std::string fname = namelist[i];
Index: /trunk/src/pvosummary.cc
===================================================================
--- /trunk/src/pvosummary.cc	(revision 83)
+++ /trunk/src/pvosummary.cc	(revision 84)
@@ -54,5 +54,5 @@
   unsigned int i;
 
-  int c, digit_optind = 0;
+  int c;
   while (true) {
     int option_index = 0;
