Index: /trunk/src/pvo-metadata.cc
===================================================================
--- /trunk/src/pvo-metadata.cc	(revision 155)
+++ /trunk/src/pvo-metadata.cc	(revision 156)
@@ -139,10 +139,11 @@
 	getcwd(cwd,cwdSize);
 	this->fileloc = cwd;
-	this->fileloc += "/";
-      }
-      this->fileloc += this->filename;
+// 	this->fileloc += "/";
+      }
+      //      this->fileloc += this->filename;
 
       std::stringstream sysmsg;
-      sysmsg << "du -kL " << this->fileloc << " | awk '{print $1}' > /tmp/size";
+      system("rm -f /tmp/size");
+      sysmsg << "du -kL " << this->fileloc << "/" << this->filename << " | awk '{print $1}' > /tmp/size";
       system(sysmsg.str().c_str());
       std::ifstream fin("/tmp/size");
@@ -526,17 +527,15 @@
     
       fileout << "Filename,"
-	      << "\"File Location\","
-	      << "File_size_bytes,"
+	      << "\"Source Name\","
 	      << "\"Project ID\","
-	      << "\"Header version\","
-	      << "Survey,"
-	      << "Telescope,"
-	      << "Site,"
-	      << "\"Source Name\","
+	      << "RAJ,"
+	      << "DECJ,"
+	      << "Data_type,"
+	      << "Obsfreq,"
+	      << "ChanBW,"
+	      << "\"Scan length\","
 	      << "\"UT Date\","
 	      << "\"UT Time\","
 	      << "MJD,"
-	      << "RAJ,"
-	      << "DECJ,"
 	      << "RAJd,"
 	      << "DECJd,"
@@ -548,19 +547,22 @@
 	      << "DM,"
 	      << "Period,"
-	      << "Config,"
-	      << "Instrument,"
-	      << "Data_type,"
-	      << "Receiver,"
-	      << "Observers,"
-	      << "Obsfreq,"
-	      << "ChanBW,"
 	      << "NChan,"
 	      << "NPol,"
 	      << "NBin,"
 	      << "NSub,"
-	      << "\"Scan length\","
 	      << "Tsamp,"
 	      << "Nbits,"
-	      << "Nbeam";
+	      << "Nbeam"
+	      << "Config,"
+	      << "Instrument,"
+	      << "Receiver,"
+	      << "\"Header version\","
+	      << "Survey,"
+	      << "Telescope,"
+	      << "Site,"
+	      << "Observers,"
+	      << "\"File Location\","
+	      << "File_size_bytes,"
+;
 	    
       if(datalist[0].showSep())	fileout  << ",Offset\n";
@@ -576,17 +578,15 @@
 
 	fileout << enclose(datalist[i].getFilename() )      << ","
-		<< enclose(datalist[i].getFileloc())        << ","
-	        << datalist[i].getFileSize()                << ","
+		<< enclose(datalist[i].getSrcname())        << ","
 		<< nullString                               << "," //project_id
-		<< enclose(datalist[i].getHeaderVersion())  << ","
-		<< enclose(datalist[i].getSurvey())         << ","
-		<< enclose(datalist[i].getTelescope())      << ","
-		<< nullString                               << "," // site
-		<< enclose(datalist[i].getSrcname())        << ","
+		<< enclose(datalist[i].getRaS())            << ","
+	       	<< enclose(datalist[i].getDecS())           << ","
+		<< enclose(datalist[i].getDataType())       << ","
+		<< floatToString(datalist[i].getObsfreq())  << ","
+		<< floatToString(datalist[i].getChanbw())   << ","
+		<< floatToString(datalist[i].getScanlen())  << ","
 		<< date                                     << ","
 		<< time                                     << ","
 		<< doubleToString(datalist[i].getMJD())     << ","
-		<< enclose(datalist[i].getRaS())            << ","
-	       	<< enclose(datalist[i].getDecS())           << ","
 	        << std::fixed << std::setprecision(6)
 	       	<< datalist[i].getRaD()                     << ","
@@ -599,19 +599,21 @@
 		<< nullString                               << "," // DM
 		<< nullString                               << "," // Period
-		<< nullString                               << "," // Config
-		<< enclose(datalist[i].getDataType())       << "," // Instrument
-		<< enclose(datalist[i].getDataType())       << ","
-		<< nullString                               << "," // Receiver
-		<< nullString                               << "," // Observers
-		<< floatToString(datalist[i].getObsfreq())  << ","
-		<< floatToString(datalist[i].getChanbw())   << ","
 		<< intToString(datalist[i].getNchan())      << ","
 		<< intToString(datalist[i].getNpol())       << ","
 		<< intToString(datalist[i].getNbin())       << ","
 		<< intToString(datalist[i].getNsub())       << ","
-		<< floatToString(datalist[i].getScanlen())  << ","
 		<< floatToString(datalist[i].getTsamp())    << ","
 		<< intToString(datalist[i].getNbits())      << ","
-		<< 1; //nbeam      
+		<< 1                                        << "," //nbeam      
+		<< nullString                               << "," // Config
+		<< enclose(datalist[i].getDataType())       << "," // Instrument
+		<< nullString                               << "," // Receiver
+		<< enclose(datalist[i].getHeaderVersion())  << ","
+		<< enclose(datalist[i].getSurvey())         << ","
+		<< enclose(datalist[i].getTelescope())      << ","
+		<< nullString                               << "," // site
+		<< nullString                               << "," // Observers
+		<< enclose(datalist[i].getFileloc())        << ","
+	        << datalist[i].getFileSize();
 
 	if(datalist[0].showSep()) 
