]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - SHUTTLE/AliShuttle.cxx
Remove typo
[u/mrichter/AliRoot.git] / SHUTTLE / AliShuttle.cxx
index 43d1ffd43e798b917456fe976d0124b4be7453b4..556a1f46d30d7520f18fe749c0b62ff869720da6 100644 (file)
@@ -28,6 +28,7 @@
 // For detSpec is used the alias name.
 //
 
+#include <stdexcept>
 #include "AliShuttle.h"
 
 #include "AliCDBManager.h"
@@ -67,6 +68,7 @@
 #include <sys/wait.h>
 
 #include <signal.h>
+using namespace std;
 
 ClassImp(AliShuttle)
 
@@ -955,7 +957,7 @@ AliShuttleStatus* AliShuttle::ReadShuttleStatus()
                 fStatusEntry = AliCDBManager::Instance()->GetStorage(GetLocalCDB())
                         ->Get(Form("/SHUTTLE/%s/%d", fCurrentDetector.Data(), path1), GetCurrentRun());
         } catch(std::exception& x) {
-                AliInfo("%s",x.what());
+                AliInfo(TString::Format("%s",x.what()));
         }
 
        if (!fStatusEntry) return 0;
@@ -3660,22 +3662,14 @@ Bool_t AliShuttle::TouchFile()
        TString dir;
        dir.Form("%s%d/SHUTTLE_DONE", fConfig->GetAlienPath(), GetCurrentYear());
        // checking whether directory for touch command exists
-       TString commandLs;
-       commandLs.Form("ls %s",dir.Data());
-       TGridResult *resultLs = dynamic_cast<TGridResult*>(gGrid->Command(commandLs));
-       if (!resultLs){
-               Log("SHUTTLE",Form("No result for %s command, returning without touching",commandLs.Data()));
+        TGridResult* resultLs = gGrid->Ls(dir.Data());
+       if (!resultLs){ // unfortunately we don't get this for ls of a non existing dir
+               Log("SHUTTLE",Form("No result for \"Ls(\"%s\")\", returning without touching", dir.Data()));
                return kFALSE;
        }
-       TMap *mapLs = dynamic_cast<TMap*>(resultLs->At(0));
-       if (!mapLs){
-               Log("SHUTTLE",Form("No map for %s command, returning without touching",commandLs.Data()));
-               delete resultLs;
-               resultLs = 0x0;
-               return kFALSE;
-       }
-       TObjString *valueLsPath = dynamic_cast<TObjString*>(mapLs->GetValue("path"));
-       if (!valueLsPath || (valueLsPath->GetString()).CompareTo(dir)!=1){ 
+
+        if ( resultLs->GetEntries() == 1 && !resultLs->GetFileName(0) ) {
+          // this is what we currently get for ls of a non existing dir
                Log("SHUTTLE",Form("No directory %s found, creating it",dir.Data()));
 
                // creating the directory