Index: trunk/BNC/bncrawfile.cpp
===================================================================
--- trunk/BNC/bncrawfile.cpp	(revision 2528)
+++ trunk/BNC/bncrawfile.cpp	(revision 2529)
@@ -45,4 +45,6 @@
 using namespace std;
 
+#define RAW_FILE_VERSION "1"
+
 // Constructor
 ////////////////////////////////////////////////////////////////////////////
@@ -64,9 +66,4 @@
     QStringList lst  = line.split(' ');
     _version = lst.value(0).toInt();
-
-    line = _inpFile->readLine();
-    bncApp* app = (bncApp*) qApp;
-    app->_currentDateAndTimeGPS = 
-                   new QDateTime(QDateTime::fromString(line, Qt::ISODate));
   }
 
@@ -76,7 +73,5 @@
     _outFile = new QFile(_fileName);
     _outFile->open(QIODevice::WriteOnly);
-    QByteArray header = "1 Version of BNC raw file\n" +
-    	                currentDateAndTimeGPS().toString(Qt::ISODate).toAscii();
-    _outFile->write(header);
+    _outFile->write(RAW_FILE_VERSION " Version of BNC raw file");
   }
 }
@@ -94,6 +89,9 @@
                               const QByteArray& format) {
   if (_outFile) {
-    QString chunkHeader = 
-      QString("\n%1 %2 %3\n").arg(QString(staID)).arg(QString(format)).arg(data.size());
+    QString chunkHeader = QString("\n%1 %2 %3 %4\n")
+                 .arg(currentDateAndTimeGPS().toString(Qt::ISODate))
+                 .arg(QString(staID))
+                 .arg(QString(format))
+                 .arg(data.size());
     _outFile->write(chunkHeader.toAscii());
     _outFile->write(data);
@@ -113,7 +111,12 @@
     QStringList lst  = line.split(' ');
     
-    _staID  = lst.value(0).toAscii();
-    _format = lst.value(1).toAscii();
-    int nBytes = lst.value(2).toInt();
+    bncApp* app = (bncApp*) qApp;
+    delete app->_currentDateAndTimeGPS;
+    app->_currentDateAndTimeGPS = 
+      new QDateTime(QDateTime::fromString(lst.value(0), Qt::ISODate));
+
+    _staID  = lst.value(1).toAscii();
+    _format = lst.value(2).toAscii();
+    int nBytes = lst.value(3).toInt();
 
     data = _inpFile->read(nBytes);
