// For detSpec is used the alias name.
//
+#include <stdexcept>
#include "AliShuttle.h"
#include "AliCDBManager.h"
#include <sys/wait.h>
#include <signal.h>
+using namespace std;
ClassImp(AliShuttle)
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;
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