37#include <sys/resource.h>
40#include "XrdVersion.hh"
104int XrdPosixXrootd::baseFD = 0;
105int XrdPosixXrootd::initDone = 0;
123 LfnPath(
const char *who,
const char *pURL,
bool ponly=
true)
126 ~LfnPath() {
if (relURL) free(relURL);}
166 if (!cbP)
return fp->
FDNum();
194 if (initDone) {myMutex.
UnLock();
return;}
205 if (*cfn ==
'+') {hush =
false; cfn++;}
206 else hush = (getenv(
"XRDPOSIX_DEBUG") == 0);
209 psxEnv->
Put(
"psx.Client",
"1");
210 XrdOucPsx psxConfig(&XrdVERSIONINFOVAR(XrdPosix), cfn, 0, psxEnv);
213 {std::cerr <<
"Posix: Unable to instantiate specified "
214 "configuration; program exiting!" <<std::endl;
250 if (!admin.
Stat(&stMode))
return -1;
254 if (amode & R_OK && !(stMode & S_IRUSR)) aOK = 0;
255 if (amode & W_OK && !(stMode & S_IWUSR)) aOK = 0;
256 if (amode & X_OK && !(stMode & S_IXUSR)) aOK = 0;
288 {
if ((ret = fP->
Close(Status))) {
delete fP; fP = 0;}
290 {std::string eTxt = Status.
ToString();
343 {fp->
UnLock();
return -ENOTCONN;}
347 std::string dataServer;
351 if (dataServer.size() >= (uint32_t)Blen)
352 {fp->
UnLock();
return -ENAMETOOLONG;}
356 strcpy(Buff, dataServer.c_str());
360 uPort = dataServerUrl.
GetPort();
370 const std::string& args,
381 resp =
"Function not supported.";
416 rc = fp->
Fstat(*buf);
418 if (rc < 0) {errno = -rc; rc = -1;}
437 if ((rc = fp->
XCio->
Sync()) < 0)
return Fault(fp, -rc);
472 if ((rc = fp->
XCio->
Trunc(offset)) < 0)
return Fault(fp, -rc);
482#define ENOATTR ENOTSUP
486 void *value,
unsigned long long size)
490 int vsize =
static_cast<int>(size);
494 if (size == 0)
return 1024;
502 else {errno =
ENOATTR;
return -1;}
503 }
else {errno = EINVAL;
return -1;}
507 if (!admin.
Stat())
return -1;
511 return admin.
Query(reqCode, value, vsize);
521 long long curroffset;
530 if (whence == SEEK_SET) curroffset = fp->
setOffset(offset);
531 else if (whence == SEEK_CUR) curroffset = fp->
addOffset(offset);
532 else if (whence == SEEK_END)
534 if (curroffset < 0)
return Fault(fp,
static_cast<int>(-curroffset));
535 curroffset = fp->
setOffset(curroffset+offset);
537 else return Fault(fp, EINVAL);
561 if (!admin.
isOK())
return -1;
579 return Open(path, oflags, mode, cbP, 0);
591 bool aOK, isRO =
false;
595 if ((oflags & O_ACCMODE) != O_RDONLY)
613 if (oflags & O_CREAT)
624 if (!(fp =
new XrdPosixFile(aOK, path, cbP, Opts)))
629 if (!aOK) {
delete fp;
return -1;}
636 if (infoP && isRO && OpenCache(*fp, *infoP))
642 if (rc > 0)
return OpenDefer(fp, cbP, XOflags, XOmode, oflags&
isStream);
649 if (!cbP) Status = fp->
clFile.
Open((std::string)path, XOflags, XOmode);
650 else Status = fp->
clFile.
Open((std::string)path, XOflags, XOmode,
651 (XrdCl::ResponseHandler *)fp);
658 if (
DEBUGON && rc != -ENOENT && rc != -ELOOP)
667 if (!(fp->AssignFD(oflags &
isStream)))
675 if (cbP) {errno = EINPROGRESS;
return -1;}
676 if (fp->Finalize(&Status))
return fp->FDNum();
707 (
int)
sizeof(
Info.cachePath),
711 {
Info.ffReady =
true;
712 DEBUG(
"File in cache url=" <<
Info.cacheURL);
718 Info.ffReady =
false;
749 if ((dirP = dP->
Open()))
return dirP;
766 long long offs, bytes;
776 if (nbyte > (
size_t)0x7fffffff)
777 return Fault(fp, EOVERFLOW,
"read size too large");
778 else iosz =
static_cast<int>(nbyte);
782 offs =
static_cast<long long>(offset);
783 bytes = fp->
XCio->
Read((
char *)buf, offs, (
int)iosz);
784 if (bytes < 0)
return Fault(fp,-bytes,
"*");
789 return (ssize_t)bytes;
807 if (nbyte > (
size_t)0x7fffffff)
818 iosz =
static_cast<int>(nbyte);
819 offs =
static_cast<long long>(offset);
823 fp->
XCio->
Read(*cbp, (
char *)buf, offs, (
int)iosz);
842 if (nbyte > (
size_t)0x7fffffff)
843 return Fault(fp,EOVERFLOW,
"write size too large");
844 else iosz =
static_cast<int>(nbyte);
848 offs =
static_cast<long long>(offset);
849 bytes = fp->
XCio->
Write((
char *)buf, offs, (
int)iosz);
850 if (bytes < 0)
return Fault(fp,-bytes,
"*");
856 return (ssize_t)iosz;
874 if (nbyte > (
size_t)0x7fffffff)
885 iosz =
static_cast<int>(nbyte);
886 offs =
static_cast<long long>(offset);
890 fp->
XCio->
Write(*cbp, (
char *)buf, offs, (
int)iosz);
909 if (nbyte > (
size_t)0x7fffffff)
return Fault(fp,EOVERFLOW);
910 else iosz =
static_cast<int>(nbyte);
915 if (bytes < 0)
return Fault(fp,-bytes);
921 return (ssize_t)bytes;
930 ssize_t bytes, totbytes = 0;
935 for (i = 0; i < iovcnt; i++)
936 {bytes =
Read(fildes,(
void *)
iov[i].iov_base,(
size_t)
iov[i].iov_len);
937 if (bytes > 0) totbytes += bytes;
938 else if (bytes < 0)
return -1;
962 if ((bytes = fp->
XCio->
ReadV(readV, n)) < 0)
return Fault(fp,-bytes);
997 dp32 = (
struct dirent *)dp64;
998 if ((
char*)dp32->d_name != (
char*)dp64->d_name)
999 {dp32->d_ino = dp64->d_ino;
1000#if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__GNU__) && !(defined(__FreeBSD_kernel__) && defined(__GLIBC__))
1001 dp32->d_off = dp64->d_off;
1004 dp32->d_type = dp64->d_type;
1006 dp32->d_reclen = dp64->d_reclen;
1007 strcpy(dp32->d_name, dp64->d_name);
1022 return (dirent64*)0;
1042 struct dirent **result)
1044 dirent64 *dp64 = 0, d64ent;
1047 if ((rc =
Readdir64_r(dirp, &d64ent, &dp64)) || !dp64)
1048 {*result = 0;
return rc;}
1050 entry->d_ino = dp64->d_ino;
1051#if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__GNU__) && !(defined(__FreeBSD_kernel__) && defined(__GLIBC__))
1052 entry->d_off = dp64->d_off;
1055 entry->d_type = dp64->d_type;
1057 entry->d_reclen = dp64->d_reclen;
1058 strcpy(entry->d_name, dp64->d_name);
1064 struct dirent64 **result)
1075 if (!(*result = dP->
nextEntry(entry))) {rc = dP->
Status(); *result = 0;}
1076 else {rc = 0; *result = entry;}
1101 {LfnPath oldF(
"rename", oldpath);
1102 LfnPath newF(
"rename", newpath);
1103 if (!oldF.path || !newF.path)
return -1;
1110 return EcRename(oldpath, newpath, admin);
1144 if (!admin.
isOK())
return -1;
1149 {LfnPath rmd(
"rmdir", path);
1150 if (!rmd.path)
return -1;
1177 else if (loc < 0) loc = 0;
1190 bool cacheChk =
false;
1194 if (!admin.
isOK())
return -1;
1203 {LfnPath statX(
"stat", path,
false);
1204 if (!statX.path)
return -1;
1207 if (rc < 0) {errno = -rc;
return -1;}
1214 return EcStat(path, buf, admin);
1216 if (!admin.
Stat(*buf))
return -1;
1222 if (cacheChk) buf->st_atime = 0;
1237 if ((rc =
Statvfs(path, &myVfs)))
return rc;
1241 memset(buf, 0,
sizeof(
struct statfs));
1242 buf->f_bsize = myVfs.f_bsize;
1243 buf->f_blocks = myVfs.f_blocks;
1244 buf->f_bfree = myVfs.f_bfree;
1245 buf->f_files = myVfs.f_files;
1246 buf->f_ffree = myVfs.f_ffree;
1247#if defined(__APPLE__) || defined(__FreeBSD__) || (defined(__FreeBSD_kernel__) && defined(__GLIBC__))
1248 buf->f_iosize = myVfs.f_frsize;
1250 buf->f_frsize = myVfs.f_frsize;
1252#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__GNU__) || (defined(__FreeBSD_kernel__) && defined(__GLIBC__))
1253 buf->f_bavail = myVfs.f_bavail;
1255#if defined(__linux__) || defined(__GNU__)
1256 buf->f_namelen = myVfs.f_namemax;
1257#elif defined(__FreeBSD__) || (defined(__FreeBSD_kernel__) && defined(__GLIBC__))
1258 buf->f_namemax = myVfs.f_namemax;
1273 if (!dP)
return EBADF;
1276 auto rc = dP->StatRet(buf);
1288 static const int szVFS =
sizeof(buf->f_bfree);
1289 static const long long max32 = 0x7fffffffLL;
1294 long long rwFree, ssFree, rwBlks;
1295 int rwNum, ssNum, rwUtil, ssUtil;
1299 if (!admin.
isOK())
return -1;
1309 rwNum =
static_cast<int>(vfsStat->
GetNodesRW());
1310 rwFree = (
long long)vfsStat->
GetFreeRW();
1319 if (rwUtil == 0) rwBlks = rwFree;
1320 else if (rwUtil >= 100) rwBlks = 0;
1321 else rwBlks = rwFree * (100 / (100 - rwUtil));
1322 if (ssUtil == 0) rwBlks += ssFree;
1323 else if (ssUtil < 100) rwBlks += ssFree * (100 / (100 - ssUtil));
1328 {
if (rwBlks > max32) rwBlks = max32;
1329 if (rwFree > max32) rwFree = max32;
1330 if (ssFree > max32) ssFree = max32;
1335 memset(buf, 0,
sizeof(
struct statvfs));
1336 buf->f_bsize = 1024*1024;
1337 buf->f_frsize = 1024*1024;
1338 buf->f_blocks =
static_cast<fsblkcnt_t
>(rwBlks);
1339 buf->f_bfree =
static_cast<fsblkcnt_t
>(rwFree + ssFree);
1340 buf->f_bavail =
static_cast<fsblkcnt_t
>(rwFree);
1341 buf->f_ffree = rwNum + ssNum;
1342 buf->f_favail = rwNum;
1343 buf->f_namemax = 255;
1344 buf->f_flag = (rwNum == 0 ? ST_RDONLY|ST_NOSUID : ST_NOSUID);
1377 uint64_t tSize =
static_cast<uint64_t
>(Size);
1381 if (!admin.
isOK())
return -1;
1386 {LfnPath trunc(
"truncate", path);
1387 if (!trunc.path)
return -1;
1408 if (!admin.
isOK())
return -1;
1413 {LfnPath remf(
"unlink", path);
1414 if (!remf.path)
return -1;
1421 return EcUnlink(path, admin);
1442 if (nbyte > (
size_t)0x7fffffff)
return Fault(fp,EOVERFLOW);
1443 else iosz =
static_cast<int>(nbyte);
1448 if (bytes < 0)
return Fault(fp,-bytes);
1454 return (ssize_t)iosz;
1463 ssize_t totbytes = 0;
1468 for (i = 0; i < iovcnt; i++)
1469 {
if (!
Write(fildes,(
void *)
iov[i].iov_base,(
size_t)
iov[i].iov_len))
1471 totbytes +=
iov[i].iov_len;
1488 if (!dirp)
return false;
1511 char *value,
int vsize)
1517 if (!admin.
Stat(0, &Mtime))
return -1;
1542 const int rc = ecmP->
Get(
emsg, reset);
1574 if (!admin.
Stat())
return -1;
1588int XrdPosixXrootd::Fault(
XrdPosixFile *fp,
int ecode,
const char *msg)
1598int XrdPosixXrootd::EcRename(
const char *oldpath,
const char *newpath,
1601 XrdCl::URL url(oldpath);
1602 XrdCl::URL newUrl(newpath);
1604 std::string file = url.GetPath();
1605 XrdCl::LocationInfo *info =
nullptr;
1606 XrdCl::FileSystem fs(oldpath);
1608 XrdCl::Buffer queryArgs(5), *queryResp =
nullptr;
1609 queryArgs.FromString(
"role");
1615 || queryResp->
ToString() ==
"server\n")
1617 if (queryResp)
delete queryResp;
1619 newUrl.GetPathWithParams()),
1623 if (queryResp)
delete queryResp;
1626 std::unique_ptr<XrdCl::LocationInfo> ptr( info );
1635 if ( ! S_ISREG(buf.st_mode))
1642 for(
size_t i = 0; i < info->
GetSize(); ++i )
1644 std::string url_i =
"root://" + info->
At(i).
GetAddress() +
"/" + file;
1645 XrdPosixAdmin *admin_i =
new XrdPosixAdmin(url_i.c_str(),admin.
ecMsg);
1647 newUrl.GetPathWithParams()),
1649 if (x != -ENOENT && rc != 0)
1651 if (admin_i)
delete admin_i;
1660int XrdPosixXrootd::EcStat(
const char *path,
struct stat *buf,
1663 XrdCl::URL url(path);
1664 std::string file = url.GetPath();
1665 XrdCl::LocationInfo *info =
nullptr;
1666 XrdCl::FileSystem fs(path);
1668 std::vector<std::string> xattrkeys;
1669 std::vector<XrdCl::XAttr> xattrvals;
1670 xattrkeys.push_back(
"xrdec.strpver");
1671 xattrkeys.push_back(
"xrdec.filesize");
1673 XrdCl::Buffer queryArgs(5), *queryResp =
nullptr;
1679 || queryResp->
ToString() ==
"server\n")
1681 if (queryResp)
delete queryResp;
1682 if (!admin.
Stat(*buf))
1686 st = fs.GetXAttr(file, xattrkeys, xattrvals, 0);
1687 if (! xattrvals[0].value.empty())
1689 std::stringstream sstream0(xattrvals[0].value);
1690 sstream0 >> buf->st_mtime;
1691 std::stringstream sstream1(xattrvals[1].value);
1692 sstream1 >> buf->st_size;
1693 buf->st_blocks = (buf->st_size + 512)/512;
1699 if (queryResp)
delete queryResp;
1702 std::unique_ptr<XrdCl::LocationInfo> ptr( info );
1710 uint64_t verNumMax = 0;
1713 for(
size_t i = 0; i < info->
GetSize(); ++i )
1715 std::string url_i =
"root://" + info->
At(i).
GetAddress() +
"/" + file;
1716 XrdPosixAdmin *admin_i =
new XrdPosixAdmin(url_i.c_str(),admin.
ecMsg);
1718 if (admin_i->
Stat(buf_i))
1720 if (! S_ISREG(buf_i.st_mode))
1722 memcpy(buf, &buf_i,
sizeof(
struct stat));
1723 if (admin_i)
delete admin_i;
1728 if (verNumMax == 0) memcpy(buf, &buf_i,
sizeof(
struct stat));
1731 XrdCl::FileSystem *fs_i =
new XrdCl::FileSystem(info->
At( i ).
GetAddress());
1734 st = fs_i->
GetXAttr(file, xattrkeys, xattrvals, 0);
1735 if (! xattrvals[0].value.empty())
1737 std::stringstream sstream(xattrvals[0].value);
1740 if ( verNum > verNumMax )
1743 memcpy(buf, &buf_i,
sizeof(
struct stat));
1744 buf->st_mtime = verNumMax;
1745 std::stringstream sstream(xattrvals[1].value);
1746 sstream >> buf->st_size;
1747 buf->st_blocks = (buf->st_size + 512)/512;
1750 if (fs_i)
delete fs_i;
1752 if (admin_i)
delete admin_i;
1766int XrdPosixXrootd::EcUnlink(
const char *path,
XrdPosixAdmin &admin)
1768 XrdCl::URL url(path);
1769 std::string file = url.GetPath();
1770 XrdCl::LocationInfo *info =
nullptr;
1771 XrdCl::FileSystem fs(path);
1773 XrdCl::Buffer queryArgs(5), *queryResp =
nullptr;
1779 || queryResp->
ToString() ==
"server\n")
1781 if (queryResp)
delete queryResp;
1786 if (queryResp)
delete queryResp;
1789 std::unique_ptr<XrdCl::LocationInfo> ptr( info );
1794 for(
size_t i = 0; i < info->
GetSize(); ++i )
1796 std::string url_i =
"root://" + info->
At(i).
GetAddress() +
"/" + file;
1797 XrdPosixAdmin *admin_i =
new XrdPosixAdmin(url_i.c_str(),admin.
ecMsg);
1801 if (x != -ENOENT && rc != 0)
1803 if (admin_i)
delete admin_i;
std::string obfuscateAuth(const std::string &input)
XrdVERSIONINFO(XrdPosix, XrdPosix)
int emsg(int rc, char *msg)
void FromString(const std::string str)
Fill the buffer from a string.
std::string ToString() const
Convert the buffer to a string.
XRootDStatus Mv(const std::string &source, const std::string &dest, ResponseHandler *handler, time_t timeout=0) XRD_WARN_UNUSED_RESULT
XRootDStatus Truncate(const std::string &path, uint64_t size, ResponseHandler *handler, time_t timeout=0) XRD_WARN_UNUSED_RESULT
XRootDStatus RmDir(const std::string &path, ResponseHandler *handler, time_t timeout=0) XRD_WARN_UNUSED_RESULT
XRootDStatus Rm(const std::string &path, ResponseHandler *handler, time_t timeout=0) XRD_WARN_UNUSED_RESULT
XRootDStatus StatVFS(const std::string &path, ResponseHandler *handler, time_t timeout=0) XRD_WARN_UNUSED_RESULT
XRootDStatus GetXAttr(const std::string &path, const std::vector< std::string > &attrs, ResponseHandler *handler, time_t timeout=0)
XRootDStatus MkDir(const std::string &path, MkDirFlags::Flags flags, Access::Mode mode, ResponseHandler *handler, time_t timeout=0) XRD_WARN_UNUSED_RESULT
XRootDStatus Open(const std::string &url, OpenFlags::Flags flags, Access::Mode mode, ResponseHandler *handler, time_t timeout=0) XRD_WARN_UNUSED_RESULT
bool IsOpen() const
Check if the file is open.
bool GetProperty(const std::string &name, std::string &value) const
const std::string & GetAddress() const
Get address.
uint32_t GetSize() const
Get number of locations.
Location & At(uint32_t index)
Get the location at index.
uint64_t GetFreeRW() const
Get size of the largest contiguous area of free r/w space (in MB).
uint64_t GetNodesStaging() const
Get number of nodes that can provide staging space.
uint8_t GetUtilizationStaging() const
Get percentage of the partition utilization represented by FreeStaging.
uint64_t GetFreeStaging() const
Get size of the largest contiguous area of free staging space (in MB).
uint8_t GetUtilizationRW() const
Get percentage of the partition utilization represented by FreeRW.
uint64_t GetNodesRW() const
Get number of nodes that can provide read/write space.
std::string GetPathWithParams() const
Get the path with params.
bool IsValid() const
Is the url valid.
int GetPort() const
Get the target port.
virtual int Read(char *buff, long long offs, int rlen)=0
virtual int Fstat(struct stat &sbuff)
virtual int Write(char *buff, long long offs, int wlen)=0
virtual long long FSize()=0
virtual bool Detach(XrdOucCacheIOCD &iocd)=0
virtual int Trunc(long long offs)=0
virtual int ReadV(const XrdOucIOVec *readV, int rnum)
virtual int LocalFilePath(const char *url, char *buff=0, int blen=0, LFP_Reason why=ForAccess, bool forall=false)
virtual int Prepare(const char *url, int oflags, mode_t mode)
int SetErrno(int ecc, int ret=-1, const char *alt=0)
int Get(std::string &ecm, bool rst=true)
void Put(const char *varname, const char *value)
bool ClientConfig(const char *pfx, bool hush=false)
bool Stat(mode_t *flags=0, time_t *mtime=0)
int Query(XrdCl::QueryCode::Code reqCode, void *buff, int bsz)
virtual void Complete(ssize_t Result)=0
An abstract class to define a callback for Open() call.
virtual void Complete(int Result)=0
static void initStat(struct stat *buf)
static bool SetConfig(XrdOucPsx &parms)
static int dirNo(DIR *dirP)
dirent64 * nextEntry(dirent64 *dp=0)
void setOffset(long offset)
void UpdtSize(size_t newsz)
long long addOffset(long long offs, int updtSz=0)
int Fstat(struct stat &buf) override
bool Close(XrdCl::XRootDStatus &Status)
const char * Path() override
bool Finalize(XrdCl::XRootDStatus *Status)
long long setOffset(long long offs)
static void * DelayedDestroy(void *)
static int Result(const XrdCl::XRootDStatus &Status, XrdOucECMsg &ecMsg, bool retneg1=false)
static XrdCl::Access::Mode Mode2Access(mode_t mode)
bool AssignFD(bool isStream=false)
static XrdPosixDir * Dir(int fildes, bool glk=false)
static XrdPosixDir * ReleaseDir(int fildes)
static int Init(int numfd)
static XrdPosixFile * ReleaseFile(int fildes)
static bool Valid(int fd)
static XrdPosixFile * File(int fildes, bool glk=false)
void Count(long long &Dest)
static const char * P2L(const char *who, const char *inP, char *&relP, bool ponly=false)
static ssize_t Readv(int fildes, const struct iovec *iov, int iovcnt)
Readv() conforms to POSIX.1-2001 readv().
static ssize_t Pread(int fildes, void *buf, size_t nbyte, off_t offset)
Pread() conforms to POSIX.1-2001 pread().
static int Closedir(DIR *dirp)
Closedir() conforms to POSIX.1-2001 closedir().
static void Seekdir(DIR *dirp, long loc)
Seekdir() conforms to POSIX.1-2001 seekdir().
static const int isStream
static int Stat(const char *path, struct stat *buf)
Stat() conforms to POSIX.1-2001 stat().
static int QueryChksum(const char *path, time_t &mtime, char *buff, int blen)
static int Mkdir(const char *path, mode_t mode)
Mkdir() conforms to POSIX.1-2001 mkdir().
static int Unlink(const char *path)
Unlink() conforms to POSIX.1-2001 unlink().
static int Rmdir(const char *path)
Rmdir() conforms to POSIX.1-2001 rmdir().
static void Rewinddir(DIR *dirp)
Rewinddir() conforms to POSIX.1-2001 rewinddir().
static void VRead(int fildes, const XrdOucIOVec *readV, int n, XrdPosixCallBackIO *cbp)
static int Rename(const char *oldpath, const char *newpath)
Rename() conforms to POSIX.1-2001 rename().
static int Close(int fildes)
Close() conforms to POSIX.1-2001 close().
static int Statvfs(const char *path, struct statvfs *buf)
Statvfs() conforms to POSIX.1-2001 statvfs().
static int Fcntl(int fildes, Fcop op, const std::string &args, std::string &resp)
static int endPoint(int FD, char *Buff, int Blen)
static ssize_t Write(int fildes, const void *buf, size_t nbyte)
Write() conforms to POSIX.1-2001 write().
static struct dirent * Readdir(DIR *dirp)
static int Readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result)
static ssize_t Writev(int fildes, const struct iovec *iov, int iovcnt)
Writev() conforms to POSIX.1-2001 writev().
static int QueryError(std::string &emsg, int fd=-1, bool reset=true)
static struct dirent64 * Readdir64(DIR *dirp)
XrdPosixXrootd(int maxfd=255, int maxdir=0, int maxthr=0)
static int Ftruncate(int fildes, off_t offset)
Ftruncate() conforms to POSIX.1-2001 ftruncate().
static long Telldir(DIR *dirp)
Telldir() conforms to POSIX.1-2001 telldir().
static bool isXrootdDir(DIR *dirp)
static int Access(const char *path, int amode)
Access() conforms to POSIX.1-2001 access().
static DIR * Opendir(const char *path)
Opendir() conforms to POSIX.1-2001 opendir().
static int Fsync(int fildes)
Fsync() conforms to POSIX.1-2001 fsync().
static int StatRet(DIR *dirp, struct stat *buf)
static long long Getxattr(const char *path, const char *name, void *value, unsigned long long size)
static long long QueryOpaque(const char *path, char *buff, int blen)
static int Statfs(const char *path, struct statfs *buf)
static int Readdir64_r(DIR *dirp, struct dirent64 *entry, struct dirent64 **result)
static ssize_t Read(int fildes, void *buf, size_t nbyte)
Read() conforms to POSIX.1-2001 read().
static int Fstat(int fildes, struct stat *buf)
Fstat() conforms to POSIX.1-2001 fstat().
static off_t Lseek(int fildes, off_t offset, int whence)
Lseek() conforms to POSIX.1-2001 lseek().
static int Open(const char *path, int oflag, mode_t mode=0, XrdPosixCallBack *cbP=0)
static ssize_t Pwrite(int fildes, const void *buf, size_t nbyte, off_t offset)
Pwrite() conforms to POSIX.1-2001 pwrite().
static int Truncate(const char *path, off_t offset)
Telldir() conforms to POSIX.1-2001 telldir().
XrdCl::DirListFlags::Flags dlFlag
@ MakePath
create the entire directory tree if it doesn't exist
Flags
Open flags, may be or'd when appropriate.
@ Read
Open only for reading.
@ Update
Open for reading and writing.
Code
XRootD query request codes.
@ OpaqueFile
Implementation dependent.
@ XAttr
Query file extended attributes.
@ Config
Query server configuration.
@ Checksum
Query file checksum.
@ Space
Query logical space stats.
bool IsOK() const
We're fine.
std::string ToString() const
Create a string representation.