31 #include <sys/types.h>
38 #include "XrdVersion.hh"
90 if (
stat(path, buff))
return -1;
94 if (buff->st_size == 0 || buff->st_blocks)
return 0;
102 return (errno ? -1 : 0);
111 if (!strcmp(val,
"all"))
return 0;
112 else if (!strcmp(val,
"online"))
return ENOENT;
113 else if (!strcmp(val,
"online:eperm"))
return EPERM;
115 eDest.
Say(
"Config",
" Invalid statlib parameter, '",var,
"=",val,
"'.");
134 const char *config_fn,
137 const char *myProg = getenv(
"XRDPROG");
138 const char *myRole = getenv(
"XRDROLE");
139 const char *xWhat =
" only online ";
142 char zRole[16], vChk[512], *val;
148 {
if (!strncmp(
"proxy", myRole, 5))
149 {strcpy(zRole,
"proxy"); myRole = zRole;}
150 else if (!strncmp(
"meta", myRole, 4))
151 {strcpy(zRole,
"manager"); myRole = zRole;}
156 strcpy(vChk,
"stat");
157 if ((val = myEnv.
Get(vChk))
163 {strcat(vChk,
"."); strcat(vChk, myProg);
164 if ((val = myEnv.
Get(vChk))
170 if (myProg && myRole)
171 {strcat(vChk,
"."); strcat(vChk, myRole);
172 if ((val = myEnv.
Get(vChk))
183 if (myProg) strncpy(vChk,
" for ", 6);
186 Say.
Say(
"Config",
" stat() allows", xWhat,
"files", vChk);
static XrdSysError eDest(0,"crypto_")
int XrdOssStatInfoParm(XrdSysError &eDest, const char *var, const char *val)
int XrdOssStatInfoResOnly
int XrdOssStatInfo(const char *path, struct stat *buff, int opts, XrdOucEnv *envP)
XrdOssStatInfo_t XrdOssStatInfoInit(XrdOss *native_oss, XrdSysLogger *Logger, const char *config_fn, const char *parms)
XrdVERSIONINFO(XrdOssStatInfoInit, Stat-GPFS+TAPE)
int(* XrdOssStatInfo_t)(const char *path, struct stat *buff, int opts, XrdOucEnv *envP)
int stat(const char *path, struct stat *buf)
char * Get(const char *varname)
void Say(const char *text1, const char *text2=0, const char *txt3=0, const char *text4=0, const char *text5=0, const char *txt6=0)