15 std::string
getTURL (
const std::string &surl)
18 std::string timeout(
"300");
19 if(
char *
p = getenv(
"CMS_STORM_LCG_GT_TIMEOUT"))
26 std::string comm(
"lcg-gt -b -T srmv2 -t " + timeout +
" srm:" + surl +
" file 2>&1");
27 LogDebug(
"StormLCGStorageMaker") <<
"command: " << comm << std::endl;
29 FILE *
pipe = popen(comm.c_str(),
"r");
32 <<
"failed to execute lcg-gt command: "
38 while ((ch = getc(pipe)) != EOF)
42 LogDebug(
"StormLCGStorageMaker") <<
"output: " << output << std::endl;
45 size_t start = output.find(
"file:", 0);
46 if (start == std::string::npos)
48 <<
"no turl found in command '" << comm <<
"' output:\n" <<
output;
51 std::string turl(output, start, output.find_first_of(
"\n", start) -
start);
52 LogDebug(
"StormLCGStorageMaker") <<
"file to open: " << turl << std::endl;
59 const std::string &surl,
77 virtual bool check (
const std::string &,
78 const std::string &
path,
82 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)
#define DEFINE_EDM_PLUGIN(factory, type, name)
tuple size
Write out results.
virtual Storage * open(const std::string &proto, const std::string &surl, int mode)