15 std::string
getTURL (
const std::string &surl)
18 if (
char *
p = getenv(
"CMS_STORM_PTG_CLIENT"))
22 <<
"$CMS_STORM_PTG_CLIENT has no value";
25 std::string comm(client +
" srm:" + surl +
" 2>&1");
26 LogDebug(
"StormStorageMaker") <<
"command: " << comm << std::endl;
28 FILE *
pipe = popen(comm.c_str(),
"r");
31 <<
"failed to execute PtG command: "
37 while ((ch = getc(pipe)) != EOF)
41 LogDebug(
"StormStorageMaker") <<
"output: " << output << std::endl;
44 size_t start = output.find(
"FilePath:", 0);
45 if (start == std::string::npos)
47 <<
"no turl found in command '" << comm <<
"' output:\n" <<
output;
50 std::string turl(output, start, output.find_first_of(
"\n", start) -
start);
51 LogDebug(
"StormStorageMaker") <<
"file to open: " << turl << std::endl;
58 const std::string &surl,
76 virtual bool check (
const std::string &,
77 const std::string &
path,
81 if (stat (
getTURL(path).c_str(), &st) != 0)
CacheHint cacheHint(void) const
Storage * wrapNonLocalFile(Storage *s, const std::string &proto, const std::string &path, int mode)
static StorageFactory * get(void)
std::string getTURL(const std::string &surl)
ReadHint readHint(void) const
virtual bool check(const std::string &, const std::string &path, IOOffset *size=0)
virtual Storage * open(const std::string &proto, const std::string &surl, int mode)
#define DEFINE_EDM_PLUGIN(factory, type, name)
tuple size
Write out results.