10 #define TRACE_PURGE(x)
24 m_oss(oss), m_oss_at(oss)
55 static const char *trc_pfx =
"FsTraversal::begin_traversal ";
57 assert(root_path && strlen(root_path) > 0 && root_path[0] ==
'/');
98 static const char *trc_pfx =
"FsTraversal::cd_down ";
139 static const char *trc_pfx =
"FsTraversal::slurp_current_dir ";
164 int rc = dh.
Readdir(fname, 256);
168 TRACE_PURGE(
" Skipping ENOENT dir entry [" << fname <<
"].");
181 TRACE_PURGE(
" Finished reading dir [" << path <<
"]. Break loop.");
184 if (fname[0] ==
'.' && (fname[1] == 0 || (fname[1] ==
'.' && fname[2] == 0)))
186 TRACE_PURGE(
" Skipping here or parent dir [" << fname <<
"]. Continue loop.");
190 if (S_ISDIR(
fstat.st_mode))
201 size_t fname_len = strlen(fname);
203 if (fname_len > info_ext_len && strncmp(&fname[fname_len - info_ext_len], info_ext, info_ext_len) == 0)
206 fname[fname_len - info_ext_len] = 0;
int stat(const char *path, struct stat *buf)
int fstat(int fildes, struct stat *buf)
const char * XrdSysE2T(int errcode)
int Opendir(XrdOssDF &atDir, const char *path, XrdOucEnv &env, XrdOssDF *&ossDF)
virtual int StatRet(struct stat *buff)
virtual int Opendir(const char *path, XrdOucEnv &env)
virtual int Readdir(char *buff, int blen)
virtual int Close(long long *retsz=0)=0
virtual XrdOssDF * newDir(const char *tident)=0
static Cache & GetInstance()
Singleton access.
std::vector< std::string > m_current_dirs
std::string m_current_path
std::vector< XrdOssDF * > m_dir_handle_stack
int close_delete(XrdOssDF *&ossDF)
void slurp_dir_ll(XrdOssDF &dh, int dir_level, const char *path, const char *trc_pfx)
bool begin_traversal(DirState *root, const char *root_path)
std::set< std::string > m_protected_top_dirs
DirState * m_root_dir_state
bool cd_down(const std::string &dir_name)
std::map< std::string, FilePairStat > m_current_files
static const char * m_traceID
static const char * s_infoExtension
static const size_t s_infoExtensionLen
DirState * find_dir(const std::string &dir, bool create_subdirs)