Skip to content

Shared File Access

Marc Mengel edited this page Feb 13, 2025 · 1 revision

Shared/Auxiliary File Access

Idea is to scan and access shared files; a couple of interfaces

   std::vector<std::tuple<long int, std::string>> list, plist, locallist;

   ifhandle = new ifdh();
   list = ifhandle->findMatchingFiles("/dir1:/dir2", glob);
   plist = prune(list);
   locallist = ifhandle->fetchSharedFiles(plist);

This uses two methods:

findMatchingFiles( std::string path, std::string pattern )

In each colon-separated directory in path, look for filenames matching the glob pattern; and return the list of matches, with their sizes. This gives a list that can then be selected from to make a list of items which the program wants to actually use.

fetchSharedFiles( std::vector<std::tuple<long int, std::string>> plist, [ std::string schema ] )

This takes a list of []{.name .size,} tuples, and returns one; where each name in the returned list is a locally accessible filename, and/or an xrootd root://host/path URL, which can be directly accessed by root code. An optional schema argument lets you specify preferred access methods, or the schema can be set by the IFDH_SHARED_SCHEMA environment variable.

The initial implementation will return /cvmfs paths unmodified, and will otherwise either copy files locally with ifdh cp, or return root: URL's for xrootd access (i.e. for DCache) depending on the schema.

Clone this wiki locally