36 #include <sys/types.h>
58 if (!
isOK())
return 0;
70 if (!(i = info->
GetSize())) {
delete info;
return 0;}
71 if (i > std::numeric_limits<ptrdiff_t>::max() /
sizeof(
XrdCl::URL))
72 {
delete info;
return 0;}
78 for( it = info->
Begin(); it != info->
End(); ++it )
79 {
if (!netLoc.
Set(it->GetAddress().c_str()) && (hName = netLoc.
Name()))
80 {std::string hString(hName);
91 if (!num) {
delete [] uVec;
return 0;}
105 if (!
isOK())
return -1;
114 {uint32_t rspSz = rspBuff->
GetSize();
116 if (rspbuff && rspSz)
118 if ( !(rspbuff[rspSz - 1]) ) --rspSz;
119 if (bsz >= (
int)rspSz + 1)
120 {strncpy((
char *)buff, rspbuff, rspSz);
121 ((
char*)buff)[rspSz] = 0;
123 return static_cast<int>(rspSz + 1);
124 }
else ecMsg.
SetErrno(ERANGE,0,
"buffer to small to hold result");
145 if (!
isOK())
return false;
159 if (mtime) *mtime =
static_cast<time_t
>(sInfo->
GetModTime());
176 if (!
isOK())
return false;
189 Stat.st_size =
static_cast<size_t>(sInfo->
GetSize());
191 Stat.st_ino =
static_cast<ino_t
>(strtoll(sInfo->
GetId().c_str(), 0, 10));
192 #if defined(__mips__) && _MIPS_SIM == _ABIO32
196 dev_t tmp_rdev =
Stat.st_rdev;
198 Stat.st_rdev = tmp_rdev;
209 Stat.st_atime = time(0);
int stat(const char *path, struct stat *buf)
Binary blob representation.
void FromString(const std::string str)
Fill the buffer from a string.
const char * GetBuffer(uint32_t offset=0) const
Get the message buffer.
uint32_t GetSize() const
Get the size of the message.
uint32_t GetSize() const
Get number of locations.
Iterator Begin()
Get the location begin iterator.
LocationList::iterator Iterator
Iterator over locations.
Iterator End()
Get the location end iterator.
uint64_t GetChangeTime() const
Get change time (in seconds since epoch)
uint64_t GetSize() const
Get size (in bytes)
uint32_t GetFlags() const
Get flags.
bool ExtendedFormat() const
Has extended stat information.
const std::string & GetId() const
Get id.
uint64_t GetModTime() const
Get modification time (in seconds since epoch)
uint64_t GetAccessTime() const
Get change time (in seconds since epoch)
std::string GetPathWithParams() const
Get the path with params.
void SetHostName(const std::string &hostName)
Set the host name.
const char * Name(const char *eName=0, const char **eText=0)
const char * Set(const char *hSpec, int pNum=PortInSpec)
int SetErrno(int ecc, int retval=-1, const char *alt=0)
bool Stat(mode_t *flags=0, time_t *mtime=0)
XrdCl::URL * FanOut(int &num)
int Query(XrdCl::QueryCode::Code reqCode, void *buff, int bsz)
static mode_t Flags2Mode(dev_t *rdv, uint32_t flags)
static int Result(const XrdCl::XRootDStatus &Status, XrdOucECMsg &ecMsg, bool retneg1=false)
Code
XRootD query request codes.
bool IsOK() const
We're fine.