12 namespace edm::storage {
17 if (
char *
p = std::getenv(
"CMS_STORM_PTG_CLIENT"))
20 throw cms::Exception(
"StormStorageMaker") <<
"$CMS_STORM_PTG_CLIENT has no value";
23 std::string comm(client +
" srm:" + surl +
" 2>&1");
24 LogDebug(
"StormStorageMaker") <<
"command: " << comm << std::endl;
26 FILE *
pipe = popen(comm.c_str(),
"r");
28 throw cms::Exception(
"StormStorageMaker") <<
"failed to execute PtG command: " << comm;
33 while ((ch = getc(pipe)) != EOF)
37 LogDebug(
"StormStorageMaker") <<
"output: " << output << std::endl;
40 size_t start = output.find(
"FilePath:", 0);
41 if (start == std::string::npos)
42 throw cms::Exception(
"StormStorageMaker") <<
"no turl found in command '" << comm <<
"' output:\n" <<
output;
46 LogDebug(
"StormStorageMaker") <<
"file to open: " << turl << std::endl;
85 using namespace edm::storage;
std::unique_ptr< Storage > open(const std::string &proto, const std::string &surl, int mode, const AuxSettings &) const override
ReadHint readHint(void) const
CacheHint cacheHint(void) const
std::unique_ptr< Storage > wrapNonLocalFile(std::unique_ptr< Storage > s, const std::string &proto, const std::string &path, int mode) const
std::string getTURL(const std::string &surl) const
bool check(const std::string &, const std::string &path, const AuxSettings &, IOOffset *size=nullptr) const override
#define DEFINE_EDM_PLUGIN(factory, type, name)
static const StorageFactory * get(void)
tuple size
Write out results.