2323#include < cstdlib>
2424#include < locale>
2525#include < boost/process.hpp>
26+ #include < TGrid.h>
2627
2728using namespace o2 ::utils;
2829using namespace std ::chrono_literals;
@@ -42,6 +43,11 @@ FileFetcher::FileFetcher(const std::string& input, const std::string& selRegex,
4243 }
4344 mNoRemoteCopy = mCopyCmd == " no-copy" ;
4445
46+ if (mCopyCmd .find (" alien" ) != std::string::npos) {
47+ if (!gGrid && !TGrid::Connect (" alien://" )) {
48+ LOG (ERROR) << " Copy command refers to alien but connection to Grid failed" ;
49+ }
50+ }
4551 // parse input list
4652 mCopyDirName = o2::utils::Str::create_unique_path (mCopyDirName , 8 );
4753 processInput (input);
@@ -127,8 +133,15 @@ void FileFetcher::processDirectory(const std::string& name)
127133// ____________________________________________________________
128134bool FileFetcher::addInputFile (const std::string& fname)
129135{
136+ static bool alienErrorPrinted = false ;
130137 if (mRemRegex && std::regex_match (fname, *mRemRegex .get ())) {
131138 mInputFiles .emplace_back (FileRef{fname, mNoRemoteCopy ? fname : createCopyName (fname), true , false });
139+ if (fname.find (" alien:" ) == 0 ) {
140+ if (!gGrid && !TGrid::Connect (" alien://" ) && !alienErrorPrinted) {
141+ LOG (ERROR) << " File name starts with alien but connection to Grid failed" ;
142+ alienErrorPrinted = true ;
143+ }
144+ }
132145 mNRemote ++;
133146 } else if (fs::exists (fname)) { // local file
134147 mInputFiles .emplace_back (FileRef{fname, " " , false , false });
0 commit comments