Index: /trunk/FACT++/src/dataLogger.cc
===================================================================
--- /trunk/FACT++/src/dataLogger.cc	(revision 10533)
+++ /trunk/FACT++/src/dataLogger.cc	(revision 10534)
@@ -321,5 +321,4 @@
 	int SetOpenedFilesOnOff(const Event& evt);
 	int SetNumSubsAndFitsOnOff(const Event& evt);
-	bool getBooleanFromString(const std::string&);
 	///boolean to prevent DIM update while desctructing the dataLogger
 	bool fDestructing;	
@@ -559,11 +558,11 @@
 		fNumSubAndFitsIsOn = true;
 		//provide services control commands
-		AddConfiguration(fDebugOnOff, "C", kSM_NightlyOpen, kSM_Logging, kSM_WaitingRun, kSM_Ready)
+                AddConfiguration(fDebugOnOff, "B:1", kSM_NightlyOpen, kSM_Logging, kSM_WaitingRun, kSM_Ready)
 				(boost::bind(&DataLogger::SetDebugOnOff, this, _1));
 		AddConfiguration(fStatsPeriod, "F", kSM_NightlyOpen, kSM_Logging, kSM_WaitingRun, kSM_Ready)
 				(boost::bind(&DataLogger::SetStatsPeriod, this, _1));
-		AddConfiguration(fStartStopOpenedFiles, "C", kSM_NightlyOpen, kSM_Logging, kSM_WaitingRun, kSM_Ready)
+                AddConfiguration(fStartStopOpenedFiles, "B:1", kSM_NightlyOpen, kSM_Logging, kSM_WaitingRun, kSM_Ready)
 				(boost::bind(&DataLogger::SetOpenedFilesOnOff ,this, _1));
-		AddConfiguration(fStartStopNumSubsAndFits, "C", kSM_NightlyOpen, kSM_Logging, kSM_WaitingRun, kSM_Ready)
+                AddConfiguration(fStartStopNumSubsAndFits, "B:1", kSM_NightlyOpen, kSM_Logging, kSM_WaitingRun, kSM_Ready)
 				(boost::bind(&DataLogger::SetNumSubsAndFitsOnOff, this, _1));
 		fDestructing = false;
@@ -1101,8 +1100,8 @@
 	if (fNightlyFileName == ".")
 	{
-		char currentPath[FILENAME_MAX];
-		getcwd(currentPath, sizeof(currentPath));
-		actualTargetDir = currentPath;
-	}
+            char currentPath[FILENAME_MAX];
+            if (getcwd(currentPath, sizeof(currentPath)))
+                actualTargetDir = currentPath;
+        }
 	else
 		actualTargetDir = fNightlyFileName;
@@ -1110,7 +1109,7 @@
 	if (fRunFileName == ".")
 	{
-		char currentPath[FILENAME_MAX];
-		getcwd(currentPath, sizeof(currentPath));
-		actualTargetDir = currentPath;
+            char currentPath[FILENAME_MAX];
+            if (getcwd(currentPath, sizeof(currentPath)))
+                actualTargetDir = currentPath;
 	}
 	else
@@ -1238,21 +1237,5 @@
 	return GetCurrentState();
 }
-// --------------------------------------------------------------------------
-//
-//! figure out whether the string means on or off
-//! @param evt
-//!		the current event. contains the instruction string: On, Off, on, off, ON, OFF, 0 or 1
-//! @returns 
-//!		the equivalent boolean
-//!
-bool DataLogger::getBooleanFromString(const std::string& str)
-{
-	if (str == "On" || str == "ON" || str == "on" || str == "1")
-		return true;
-	if (str == "Off" || str == "OFF" || str == "off" || str == "0")
-		return false;
-	Error("Argument could not be converted to boolean. please use On/on/ON/1 or Off/off/OFF/0. defaulting to false.");
-	return false;
-}
+
 // --------------------------------------------------------------------------
 //
@@ -1266,5 +1249,5 @@
 {
 	bool backupDebug = fDebugIsOn;
-	fDebugIsOn = getBooleanFromString(evt.GetText());
+	fDebugIsOn = evt.GetBool();
 	if (fDebugIsOn == backupDebug)
 		Warn("Warning: debug mode was already in the requested state");
@@ -1272,5 +1255,5 @@
 	{
 		stringstream str;
-		str << "Debug mode is now " << evt.GetText();
+		str << "Debug mode is now " << fDebugIsOn;
 		Message(str.str());
 	}
@@ -1327,5 +1310,5 @@
 {
 	bool backupOpened = fOpenedFilesIsOn;
-	fOpenedFilesIsOn = getBooleanFromString(evt.GetText());
+	fOpenedFilesIsOn = evt.GetBool();
 	if (fOpenedFilesIsOn == backupOpened)
 		Warn("Warning: opened files service mode was already in the requested state");
@@ -1333,5 +1316,5 @@
 	{
 		stringstream str;
-		str << "Opened files service mode is now " << evt.GetText();
+		str << "Opened files service mode is now " << fOpenedFilesIsOn;
 		Message(str.str());
 	}
@@ -1350,5 +1333,5 @@
 {
 	bool backupSubs = fNumSubAndFitsIsOn;
-	fNumSubAndFitsIsOn = getBooleanFromString(evt.GetText());
+	fNumSubAndFitsIsOn = evt.GetBool();
 	if (fNumSubAndFitsIsOn == backupSubs)
 		Warn("Warning: Number of subscriptions service mode was already in the requested state");
@@ -1356,5 +1339,5 @@
 	{
 		stringstream str;
-		str << "Number of subscriptions service mode is now " << evt.GetText();
+		str << "Number of subscriptions service mode is now " << fNumSubAndFitsIsOn;
 		Message(str.str());
 	}
@@ -1497,12 +1480,14 @@
 	{
 		char currentPath[FILENAME_MAX];
-		getcwd(currentPath, sizeof(currentPath));
-		if (errno != 0)
-		{
-			std::stringstream str;
-			str << "Unable retrieve current path" << ". Reason: " << strerror(errno) << " [" << errno << "]";
-			Error(str);	
-		}
-		actualTargetDir = currentPath;
+                if (!getcwd(currentPath, sizeof(currentPath)))
+                {
+                    if (errno != 0)
+                    {
+                        std::stringstream str;
+                        str << "Unable retrieve current path" << ". Reason: " << strerror(errno) << " [" << errno << "]";
+                        Error(str);
+                    }
+                }
+                actualTargetDir = currentPath;
 	}
 	else
@@ -1555,6 +1540,6 @@
 		{
 			char currentPath[FILENAME_MAX];
-			getcwd(currentPath, sizeof(currentPath));
-			actualTargetDir = currentPath;
+			if (getcwd(currentPath, sizeof(currentPath)))
+                            actualTargetDir = currentPath;
 		}
 		else
@@ -1611,6 +1596,6 @@
 			{
 				char currentPath[FILENAME_MAX];
-				getcwd(currentPath, sizeof(currentPath));
-				actualTargetDir = currentPath;
+                                if (getcwd(currentPath, sizeof(currentPath)))
+                                    actualTargetDir = currentPath;
 			}
 			else
@@ -1811,11 +1796,13 @@
 	{
 		char currentPath[FILENAME_MAX];
-		getcwd(currentPath, sizeof(currentPath));
-		if (errno != 0)
-		{
-			std::stringstream str;
-			str << "Unable to retrieve the current path" << ". Reason: " << strerror(errno) << " [" << errno << "]";
-			Error(str);	
-		}		
+                if (!getcwd(currentPath, sizeof(currentPath)))
+                {
+                    if (errno != 0)
+                    {
+                        std::stringstream str;
+                        str << "Unable to retrieve the current path" << ". Reason: " << strerror(errno) << " [" << errno << "]";
+                        Error(str);
+                    }
+                }
 		actualTargetDir = currentPath;
 	}
