XRootD
XrdCl::FileSystem Class Reference

Send file/filesystem queries to an XRootD cluster. More...

#include <XrdClFileSystem.hh>

+ Collaboration diagram for XrdCl::FileSystem:

Public Types

typedef std::vector< LocationInfoLocationList
 Location list. More...
 

Public Member Functions

 FileSystem (const URL &url, bool enablePlugIns=true)
 
 ~FileSystem ()
 Destructor. More...
 
XRootDStatus ChMod (const std::string &path, Access::Mode mode, ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
 
XRootDStatus ChMod (const std::string &path, Access::Mode mode, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
 
XRootDStatus DeepLocate (const std::string &path, OpenFlags::Flags flags, LocationInfo *&response, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
 
XRootDStatus DeepLocate (const std::string &path, OpenFlags::Flags flags, ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
 
XRootDStatus DelXAttr (const std::string &path, const std::vector< std::string > &attrs, ResponseHandler *handler, uint16_t timeout=0)
 
XRootDStatus DelXAttr (const std::string &path, const std::vector< std::string > &attrs, std::vector< XAttrStatus > &result, uint16_t timeout=0)
 
XRootDStatus DirList (const std::string &path, DirListFlags::Flags flags, DirectoryList *&response, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
 
XRootDStatus DirList (const std::string &path, DirListFlags::Flags flags, ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
 
bool GetProperty (const std::string &name, std::string &value) const
 
XRootDStatus GetXAttr (const std::string &path, const std::vector< std::string > &attrs, ResponseHandler *handler, uint16_t timeout=0)
 
XRootDStatus GetXAttr (const std::string &path, const std::vector< std::string > &attrs, std::vector< XAttr > &result, uint16_t timeout=0)
 
XRootDStatus ListXAttr (const std::string &path, ResponseHandler *handler, uint16_t timeout=0)
 
XRootDStatus ListXAttr (const std::string &path, std::vector< XAttr > &result, uint16_t timeout=0)
 
XRootDStatus Locate (const std::string &path, OpenFlags::Flags flags, LocationInfo *&response, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
 
XRootDStatus Locate (const std::string &path, OpenFlags::Flags flags, ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
 
XRootDStatus MkDir (const std::string &path, MkDirFlags::Flags flags, Access::Mode mode, ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
 
XRootDStatus MkDir (const std::string &path, MkDirFlags::Flags flags, Access::Mode mode, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
 
XRootDStatus Mv (const std::string &source, const std::string &dest, ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
 
XRootDStatus Mv (const std::string &source, const std::string &dest, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
 
XRootDStatus Ping (ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
 
XRootDStatus Ping (uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
 
XRootDStatus Prepare (const std::vector< std::string > &fileList, PrepareFlags::Flags flags, uint8_t priority, Buffer *&response, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
 
XRootDStatus Prepare (const std::vector< std::string > &fileList, PrepareFlags::Flags flags, uint8_t priority, ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
 
XRootDStatus Protocol (ProtocolInfo *&response, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
 
XRootDStatus Protocol (ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
 
XRootDStatus Query (QueryCode::Code queryCode, const Buffer &arg, Buffer *&response, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
 
XRootDStatus Query (QueryCode::Code queryCode, const Buffer &arg, ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
 
XRootDStatus Rm (const std::string &path, ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
 
XRootDStatus Rm (const std::string &path, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
 
XRootDStatus RmDir (const std::string &path, ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
 
XRootDStatus RmDir (const std::string &path, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
 
XRootDStatus SendCache (const std::string &info, Buffer *&response, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
 Send cache info to the server - sync. More...
 
XRootDStatus SendCache (const std::string &info, ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
 
XRootDStatus SendInfo (const std::string &info, Buffer *&response, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
 Send info to the server - sync. More...
 
XRootDStatus SendInfo (const std::string &info, ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
 
bool SetProperty (const std::string &name, const std::string &value)
 
XRootDStatus SetXAttr (const std::string &path, const std::vector< xattr_t > &attrs, ResponseHandler *handler, uint16_t timeout=0)
 
XRootDStatus SetXAttr (const std::string &path, const std::vector< xattr_t > &attrs, std::vector< XAttrStatus > &result, uint16_t timeout=0)
 
XRootDStatus Stat (const std::string &path, ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
 
XRootDStatus Stat (const std::string &path, StatInfo *&response, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
 
XRootDStatus StatVFS (const std::string &path, ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
 
XRootDStatus StatVFS (const std::string &path, StatInfoVFS *&response, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
 
XRootDStatus Truncate (const std::string &path, uint64_t size, ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
 
XRootDStatus Truncate (const std::string &path, uint64_t size, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
 

Friends

class AssignLBHandler
 
class ForkHandler
 

Detailed Description

Send file/filesystem queries to an XRootD cluster.

Definition at line 202 of file XrdClFileSystem.hh.

Member Typedef Documentation

◆ LocationList

Location list.

Definition at line 208 of file XrdClFileSystem.hh.

Constructor & Destructor Documentation

◆ FileSystem()

XrdCl::FileSystem::FileSystem ( const URL url,
bool  enablePlugIns = true 
)

Constructor

Parameters
urlURL of the entry-point server to be contacted
enablePlugInsenable the plug-in mechanism for this object

Definition at line 1083 of file XrdClFileSystem.cc.

1083  :
1084  pImpl( new FileSystemImpl( url ) ),
1085  pPlugIn(0)
1086  {
1087  //--------------------------------------------------------------------------
1088  // Check if we need to install a plug-in for this URL
1089  //--------------------------------------------------------------------------
1090  if( enablePlugIns )
1091  {
1092  Log *log = DefaultEnv::GetLog();
1093  std::string urlStr = url.GetURL();
1095  if( fact )
1096  {
1097  pPlugIn = fact->CreateFileSystem( urlStr );
1098  if( !pPlugIn )
1099  {
1100  log->Error( FileMsg, "Plug-in factory failed to produce a plug-in "
1101  "for %s, continuing without one", urlStr.c_str() );
1102  }
1103  }
1104  }
1105 
1106  if( !pPlugIn )
1108  }
static PlugInManager * GetPlugInManager()
Get plug-in manager.
static Log * GetLog()
Get default log.
static ForkHandler * GetForkHandler()
Get the fork handler.
void RegisterFileSystemObject(FileSystem *fs)
Handle diagnostics.
Definition: XrdClLog.hh:101
void Error(uint64_t topic, const char *format,...)
Report an error.
Definition: XrdClLog.cc:231
virtual FileSystemPlugIn * CreateFileSystem(const std::string &url)=0
Create a file system plug-in for the given URL.
PlugInFactory * GetFactory(const std::string url)
std::string GetURL() const
Get the URL.
Definition: XrdClURL.hh:86
const uint64_t FileMsg
Implementation holding the data members.

References XrdCl::PlugInFactory::CreateFileSystem(), XrdCl::Log::Error(), XrdCl::FileMsg, XrdCl::PlugInManager::GetFactory(), XrdCl::DefaultEnv::GetForkHandler(), XrdCl::DefaultEnv::GetLog(), XrdCl::DefaultEnv::GetPlugInManager(), XrdCl::URL::GetURL(), and XrdCl::ForkHandler::RegisterFileSystemObject().

Referenced by DirList().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ~FileSystem()

XrdCl::FileSystem::~FileSystem ( )

Destructor.

Definition at line 1113 of file XrdClFileSystem.cc.

1114  {
1115  if( !pPlugIn )
1116  {
1119  }
1120 
1121  delete pPlugIn;
1122  delete pImpl;
1123  }
void UnRegisterFileSystemObject(FileSystem *fs)
Un-register a file system object.

References XrdCl::DefaultEnv::GetForkHandler(), and XrdCl::ForkHandler::UnRegisterFileSystemObject().

+ Here is the call graph for this function:

Member Function Documentation

◆ ChMod() [1/2]

XRootDStatus XrdCl::FileSystem::ChMod ( const std::string &  path,
Access::Mode  mode,
ResponseHandler handler,
uint16_t  timeout = 0 
)

Change access mode on a directory or a file - async

Parameters
pathfile/directory path
modeaccess mode, or'd Access::Mode
handlerhandler to be notified when the response arrives
timeouttimeout value, if 0 the environment default will be used
Returns
status of the operation

Definition at line 1462 of file XrdClFileSystem.cc.

1466  {
1467  if( pPlugIn )
1468  return pPlugIn->ChMod( path, mode, handler, timeout );
1469 
1470  std::string fPath = FilterXrdClCgi( path );
1471 
1472  Message *msg;
1473  ClientChmodRequest *req;
1474  MessageUtils::CreateRequest( msg, req, fPath.length() );
1475 
1476  req->requestid = kXR_chmod;
1477  req->mode = mode;
1478  req->dlen = fPath.length();
1479  msg->Append( fPath.c_str(), fPath.length(), 24 );
1480  MessageSendParams params; params.timeout = timeout;
1483 
1484  return FileSystemData::Send( pImpl->fsdata, msg, handler, params );
1485  }
@ kXR_chmod
Definition: XProtocol.hh:114
kXR_unt16 requestid
Definition: XProtocol.hh:191
void Append(const char *buffer, uint32_t size)
Append data at the position pointed to by the append cursor.
Definition: XrdClBuffer.hh:164
virtual XRootDStatus ChMod(const std::string &path, Access::Mode mode, ResponseHandler *handler, uint16_t timeout)
static void ProcessSendParams(MessageSendParams &sendParams)
Process sending params.
static void CreateRequest(Message *&msg, Request *&req, uint32_t payloadSize=0)
Create a message.
The message representation used throughout the system.
Definition: XrdClMessage.hh:30
static void SetDescription(Message *msg)
Get the description of a message.
static XRootDStatus Send(std::shared_ptr< FileSystemData > &fs, Message *msg, ResponseHandler *handler, MessageSendParams &params)
std::shared_ptr< FileSystemData > fsdata

References XrdCl::Buffer::Append(), XrdCl::FileSystemPlugIn::ChMod(), XrdCl::MessageUtils::CreateRequest(), ClientChmodRequest::dlen, XrdCl::FileSystemImpl::fsdata, kXR_chmod, ClientChmodRequest::mode, XrdCl::MessageUtils::ProcessSendParams(), ClientChmodRequest::requestid, XrdCl::FileSystemData::Send(), XrdCl::XRootDTransport::SetDescription(), and XrdCl::MessageSendParams::timeout.

Referenced by ChMod(), and DoChMod().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ChMod() [2/2]

XRootDStatus XrdCl::FileSystem::ChMod ( const std::string &  path,
Access::Mode  mode,
uint16_t  timeout = 0 
)

Change access mode on a directory or a file - sync

Parameters
pathfile/directory path
modeaccess mode, or'd Access::Mode
timeouttimeout value, if 0 the environment default will be used
Returns
status of the operation

Definition at line 1490 of file XrdClFileSystem.cc.

1493  {
1494  SyncResponseHandler handler;
1495  Status st = ChMod( path, mode, &handler, timeout );
1496  if( !st.IsOK() )
1497  return st;
1498 
1499  return MessageUtils::WaitForStatus( &handler );
1500  }
XRootDStatus ChMod(const std::string &path, Access::Mode mode, ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
static XRootDStatus WaitForStatus(SyncResponseHandler *handler)
Wait and return the status of the query.
Synchronize the response.
Procedure execution status.
Definition: XrdClStatus.hh:115
bool IsOK() const
We're fine.
Definition: XrdClStatus.hh:124

References ChMod(), XrdCl::Status::IsOK(), and XrdCl::MessageUtils::WaitForStatus().

+ Here is the call graph for this function:

◆ DeepLocate() [1/2]

XRootDStatus XrdCl::FileSystem::DeepLocate ( const std::string &  path,
OpenFlags::Flags  flags,
LocationInfo *&  response,
uint16_t  timeout = 0 
)

Locate a file, recursively locate all disk servers - sync

Parameters
pathpath to the file to be located
flagssome of the OpenFlags::Flags
responsethe response (to be deleted by the user)
timeouttimeout value, if 0 the environment default will be used
Returns
status of the operation

Definition at line 1185 of file XrdClFileSystem.cc.

1189  {
1190  SyncResponseHandler handler;
1191  Status st = DeepLocate( path, flags, &handler, timeout );
1192  if( !st.IsOK() )
1193  return st;
1194 
1195  return MessageUtils::WaitForResponse( &handler, response );
1196  }
XRootDStatus DeepLocate(const std::string &path, OpenFlags::Flags flags, ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
static XrdCl::XRootDStatus WaitForResponse(SyncResponseHandler *handler, Type *&response)
Wait for the response.

References DeepLocate(), XrdCl::Status::IsOK(), and XrdCl::MessageUtils::WaitForResponse().

+ Here is the call graph for this function:

◆ DeepLocate() [2/2]

XRootDStatus XrdCl::FileSystem::DeepLocate ( const std::string &  path,
OpenFlags::Flags  flags,
ResponseHandler handler,
uint16_t  timeout = 0 
)

Locate a file, recursively locate all disk servers - async

Parameters
pathpath to the file to be located
flagssome of the OpenFlags::Flags
handlerhandler to be notified when the response arrives, the response parameter will hold a Buffer object if the procedure is successful
timeouttimeout value, if 0 the environment default will be used
Returns
status of the operation

Definition at line 1173 of file XrdClFileSystem.cc.

1177  {
1178  return Locate( path, flags,
1179  new DeepLocateHandler( handler, path, flags, timeout ), timeout );
1180  }
XRootDStatus Locate(const std::string &path, OpenFlags::Flags flags, ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT

References Locate().

Referenced by DeepLocate(), DirList(), DoLocate(), XrdCl::FileSystemUtils::GetSpaceInfo(), and XrdFfsPosix_mkdir().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DelXAttr() [1/2]

XRootDStatus XrdCl::FileSystem::DelXAttr ( const std::string &  path,
const std::vector< std::string > &  attrs,
ResponseHandler handler,
uint16_t  timeout = 0 
)

Delete extended attributes - async

Parameters
attrs: list of extended attributes to set
handler: handler to be notified when the response arrives, the response parameter will hold a std::vector of XAttrStatus objects
timeout: timeout value, if 0 the environment default will be used
Returns
: status of the operation

Definition at line 2087 of file XrdClFileSystem.cc.

2091  {
2092  if( pPlugIn )
2094 
2095  return XAttrOperationImpl( kXR_fattrDel, 0, path, attrs, handler, timeout );
2096  }
@ kXR_fattrDel
Definition: XProtocol.hh:270
const uint16_t stError
An error occurred that could potentially be retried.
Definition: XrdClStatus.hh:32
const uint16_t errNotSupported
Definition: XrdClStatus.hh:62

References XrdCl::errNotSupported, kXR_fattrDel, and XrdCl::stError.

Referenced by DelXAttr(), and DoXAttr().

+ Here is the caller graph for this function:

◆ DelXAttr() [2/2]

XRootDStatus XrdCl::FileSystem::DelXAttr ( const std::string &  path,
const std::vector< std::string > &  attrs,
std::vector< XAttrStatus > &  result,
uint16_t  timeout = 0 
)

Delete extended attributes - sync

Parameters
attrs: list of extended attributes to set
result: result of the operation
timeout: timeout value, if 0 the environment default will be used
Returns
: status of the operation

Definition at line 2101 of file XrdClFileSystem.cc.

2105  {
2106  SyncResponseHandler handler;
2107  XRootDStatus st = DelXAttr( path, attrs, &handler, timeout );
2108  if( !st.IsOK() )
2109  return st;
2110 
2111  std::vector<XAttrStatus> *resp = 0;
2112  st = MessageUtils::WaitForResponse( &handler, resp );
2113  if( resp ) result.swap( *resp );
2114  delete resp;
2115 
2116  return st;
2117  }
XRootDStatus DelXAttr(const std::string &path, const std::vector< std::string > &attrs, ResponseHandler *handler, uint16_t timeout=0)

References DelXAttr(), XrdCl::Status::IsOK(), and XrdCl::MessageUtils::WaitForResponse().

+ Here is the call graph for this function:

◆ DirList() [1/2]

XRootDStatus XrdCl::FileSystem::DirList ( const std::string &  path,
DirListFlags::Flags  flags,
DirectoryList *&  response,
uint16_t  timeout = 0 
)

List entries of a directory - sync

Parameters
pathdirectory path
flagsDirListFlags
responsethe response (to be deleted by the user)
timeouttimeout value, if 0 the environment default will be used
Returns
status of the operation

Definition at line 1716 of file XrdClFileSystem.cc.

1720  {
1721  //--------------------------------------------------------------------------
1722  // Chunked response is only possible for async DirList call
1723  //--------------------------------------------------------------------------
1724  if( flags & DirListFlags::Chunked )
1726 
1727  //--------------------------------------------------------------------------
1728  // If the path ends with '.zip' extension add Zip flag
1729  //--------------------------------------------------------------------------
1730  static const std::string zip_sufix = ".zip";
1731  if( path.size() >= zip_sufix.size() &&
1732  std::equal( zip_sufix.rbegin(), zip_sufix.rend(), path.rbegin() ) )
1733  flags |= DirListFlags::Zip;
1734 
1735  //--------------------------------------------------------------------------
1736  // We do the deep locate and ask all the returned servers for the list
1737  //--------------------------------------------------------------------------
1738  if( flags & DirListFlags::Locate )
1739  {
1740  //------------------------------------------------------------------------
1741  // Locate all the disk servers holding the directory
1742  //------------------------------------------------------------------------
1743  LocationInfo *locations;
1744  std::string locatePath = "*"; locatePath += path;
1745  XRootDStatus st = DeepLocate( locatePath,
1747 
1748  if( !st.IsOK() )
1749  return st;
1750 
1751  if( locations->GetSize() == 0 )
1752  {
1753  delete locations;
1754  return XRootDStatus( stError, errNotFound );
1755  }
1756 
1757  // Check if destination is a data server
1758  bool isserver = false;
1759  AnyObject obj;
1761  if( st.IsOK() )
1762  {
1763  int *ptr = 0;
1764  obj.Get( ptr );
1765  isserver = ( *ptr & kXR_isServer );
1766  delete ptr;
1767  }
1768 
1769  if( !isserver )
1770  {
1771  //------------------------------------------------------------------------
1772  // Ask each server for a directory list
1773  //------------------------------------------------------------------------
1774  flags &= ~DirListFlags::Locate;
1775  FileSystem *fs;
1776  DirectoryList *currentResp = 0;
1777  uint32_t errors = 0;
1778  uint32_t numLocations = locations->GetSize();
1779  bool partial = st.code == suPartial ? true : false;
1780 
1781  response = new DirectoryList();
1782  response->SetParentName( path );
1783 
1784  for( uint32_t i = 0; i < locations->GetSize(); ++i )
1785  {
1786  URL locationURL( locations->At(i).GetAddress() );
1787  // make sure the original protocol is preserved (root vs roots)
1788  locationURL.SetProtocol( pImpl->fsdata->pUrl->GetProtocol() );
1789  fs = new FileSystem( locationURL );
1790  st = fs->DirList( path, flags, currentResp, timeout );
1791  if( !st.IsOK() )
1792  {
1793  ++errors;
1794  delete fs;
1795  continue;
1796  }
1797 
1798  if( st.code == suPartial )
1799  partial = true;
1800 
1802 
1803  for( it = currentResp->Begin(); it != currentResp->End(); ++it )
1804  {
1805  response->Add( *it );
1806  *it = 0;
1807  }
1808 
1809  delete fs;
1810  delete currentResp;
1811  fs = 0;
1812  currentResp = 0;
1813  }
1814  delete locations;
1815 
1816  if( flags & DirListFlags::Merge )
1817  MergeDirListHandler::Merge( response );
1818 
1819  if( errors || partial )
1820  {
1821  if( errors == numLocations )
1822  return st;
1823  return XRootDStatus( stOK, suPartial );
1824  }
1825  return XRootDStatus();
1826  }
1827  else
1828  delete locations;
1829  }
1830 
1831  //--------------------------------------------------------------------------
1832  // We just ask the current server
1833  //--------------------------------------------------------------------------
1834  SyncResponseHandler handler;
1835  XRootDStatus st = DirList( path, flags, &handler, timeout );
1836  if( !st.IsOK() )
1837  return st;
1838 
1839  st = MessageUtils::WaitForResponse( &handler, response );
1840  if( !st.IsOK() )
1841  return st;
1842 
1843  //--------------------------------------------------------------------------
1844  // Do the stats on all the entries if necessary.
1845  // If we already have the stat objects it means that the bulk stat has
1846  // succeeded.
1847  //--------------------------------------------------------------------------
1848  if( !(flags & DirListFlags::Stat) )
1849  return st;
1850 
1851  if( response->GetSize() && response->At(0)->GetStatInfo() )
1852  return st;
1853 
1854  uint32_t quota = response->GetSize() <= 1024 ? response->GetSize() : 1024;
1855  RequestSync sync( response->GetSize(), quota );
1856  for( uint32_t i = 0; i < response->GetSize(); ++i )
1857  {
1858  std::string fullPath = response->GetParentName()+response->At(i)->GetName();
1859  ResponseHandler *handler = new DirListStatHandler( response, i, &sync );
1860  st = Stat( fullPath, handler, timeout );
1861  if( !st.IsOK() )
1862  {
1863  sync.TaskDone( false );
1864  delete handler;
1865  }
1866  sync.WaitForQuota();
1867  }
1868  sync.WaitForAll();
1869 
1870  if( sync.FailureCount() )
1871  return XRootDStatus( stOK, suPartial );
1872 
1873  return XRootDStatus();
1874  }
#define kXR_isServer
Definition: XProtocol.hh:1155
void Get(Type &object)
Retrieve the object being held.
static PostMaster * GetPostMaster()
Get default post master.
const std::string & GetName() const
Get file name.
StatInfo * GetStatInfo()
Get the stat info object.
ListEntry * At(uint32_t index)
Get an entry at given index.
void Add(ListEntry *entry)
Add an entry to the list - takes ownership.
uint32_t GetSize() const
Get the size of the listing.
DirList::iterator Iterator
Directory listing iterator.
Iterator End()
Get the end iterator.
Iterator Begin()
Get the begin iterator.
const std::string & GetParentName() const
Get parent directory name.
void SetParentName(const std::string &parent)
Set name of the parent directory.
Send file/filesystem queries to an XRootD cluster.
XRootDStatus DirList(const std::string &path, DirListFlags::Flags flags, ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
XRootDStatus Stat(const std::string &path, ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
FileSystem(const URL &url, bool enablePlugIns=true)
const std::string & GetAddress() const
Get address.
Path location info.
uint32_t GetSize() const
Get number of locations.
Location & At(uint32_t index)
Get the location at index.
Status QueryTransport(const URL &url, uint16_t query, AnyObject &result)
A helper running a fixed number of requests at a given time.
Handle an async response.
URL representation.
Definition: XrdClURL.hh:31
const uint16_t suPartial
Definition: XrdClStatus.hh:41
const uint16_t errNotFound
Definition: XrdClStatus.hh:100
const uint16_t stOK
Everything went OK.
Definition: XrdClStatus.hh:31
@ Stat
Stat each entry.
@ Merge
Merge duplicates.
@ Zip
List content of ZIP files.
@ Chunked
Serve chunked results for better performance.
uint16_t code
Error type, or additional hints on what to do.
Definition: XrdClStatus.hh:147
static const uint16_t ServerFlags
returns server flags

References FileSystem(), XrdCl::DirectoryList::Add(), XrdCl::LocationInfo::At(), XrdCl::DirectoryList::At(), XrdCl::DirectoryList::Begin(), XrdCl::DirListFlags::Chunked, XrdCl::Status::code, XrdCl::OpenFlags::Compress, DeepLocate(), DirList(), XrdCl::DirectoryList::End(), XrdCl::errNotFound, XrdCl::errNotSupported, XrdCl::RequestSync::FailureCount(), XrdCl::FileSystemImpl::fsdata, XrdCl::AnyObject::Get(), XrdCl::LocationInfo::Location::GetAddress(), XrdCl::DirectoryList::ListEntry::GetName(), XrdCl::DirectoryList::GetParentName(), XrdCl::DefaultEnv::GetPostMaster(), XrdCl::LocationInfo::GetSize(), XrdCl::DirectoryList::GetSize(), XrdCl::DirectoryList::ListEntry::GetStatInfo(), XrdCl::OpenFlags::IntentDirList, XrdCl::Status::IsOK(), kXR_isServer, XrdCl::DirListFlags::Locate, Locate(), XrdCl::DirListFlags::Merge, XrdCl::OpenFlags::PrefName, XrdCl::PostMaster::QueryTransport(), XrdCl::XRootDQuery::ServerFlags, XrdCl::DirectoryList::SetParentName(), XrdCl::URL::SetProtocol(), XrdCl::DirListFlags::Stat, Stat(), XrdCl::stError, XrdCl::stOK, XrdCl::suPartial, XrdCl::RequestSync::TaskDone(), XrdCl::RequestSync::WaitForAll(), XrdCl::RequestSync::WaitForQuota(), XrdCl::MessageUtils::WaitForResponse(), and XrdCl::DirListFlags::Zip.

+ Here is the call graph for this function:

◆ DirList() [2/2]

XRootDStatus XrdCl::FileSystem::DirList ( const std::string &  path,
DirListFlags::Flags  flags,
ResponseHandler handler,
uint16_t  timeout = 0 
)

List entries of a directory - async

Parameters
pathdirectory path
flagscurrently unused
handlerhandler to be notified when the response arrives, the response parameter will hold a DirectoryList object if the procedure is successful
timeouttimeout value, if 0 the environment default will be used
Returns
status of the operation

Definition at line 1662 of file XrdClFileSystem.cc.

1666  {
1667  if( pPlugIn )
1668  return pPlugIn->DirList( path, flags, handler, timeout );
1669 
1670  URL url = URL( path );
1671  std::string fPath = FilterXrdClCgi( path );
1672 
1673  if( flags & DirListFlags::Zip )
1674  {
1675  // stat the file to check if it is a directory or a file
1676  // the ZIP handler will take care of the rest
1677  ZipListHandler *zipHandler = new ZipListHandler( *pImpl->fsdata->pUrl, path, flags, handler, timeout );
1678  XRootDStatus st = Stat( path, zipHandler, timeout );
1679  if( !st.IsOK() )
1680  delete zipHandler;
1681  return st;
1682  }
1683 
1684  Message *msg;
1685  ClientDirlistRequest *req;
1686  MessageUtils::CreateRequest( msg, req, fPath.length() );
1687 
1688  req->requestid = kXR_dirlist;
1689  req->dlen = fPath.length();
1690 
1691  if( ( flags & DirListFlags::Stat ) || ( flags & DirListFlags::Recursive ) )
1692  req->options[0] = kXR_dstat;
1693 
1694  if( ( flags & DirListFlags::Cksm ) )
1695  req->options[0] = kXR_dstat | kXR_dcksm;
1696 
1697  if( flags & DirListFlags::Recursive )
1698  handler = new RecursiveDirListHandler( *pImpl->fsdata->pUrl, url.GetPath(), flags, handler, timeout );
1699 
1700  if( flags & DirListFlags::Merge )
1701  handler = new MergeDirListHandler( flags & DirListFlags::Chunked, handler );
1702 
1703  msg->Append( fPath.c_str(), fPath.length(), 24 );
1704  MessageSendParams params; params.timeout = timeout;
1705  if( flags & DirListFlags::Chunked )
1706  params.chunkedResponse = true;
1709 
1710  return FileSystemData::Send( pImpl->fsdata, msg, handler, params );
1711  }
kXR_char options[1]
Definition: XProtocol.hh:248
@ kXR_dstat
Definition: XProtocol.hh:240
@ kXR_dcksm
Definition: XProtocol.hh:241
@ kXR_dirlist
Definition: XProtocol.hh:116
virtual XRootDStatus DirList(const std::string &path, DirListFlags::Flags flags, ResponseHandler *handler, uint16_t timeout)
const std::string & GetPath() const
Get the path.
Definition: XrdClURL.hh:212
@ Recursive
Do a recursive listing.
@ Cksm
Get checksum for every entry.

References XrdCl::Buffer::Append(), XrdCl::DirListFlags::Chunked, XrdCl::MessageSendParams::chunkedResponse, XrdCl::DirListFlags::Cksm, XrdCl::MessageUtils::CreateRequest(), XrdCl::FileSystemPlugIn::DirList(), ClientDirlistRequest::dlen, XrdCl::FileSystemImpl::fsdata, XrdCl::URL::GetPath(), XrdCl::Status::IsOK(), kXR_dcksm, kXR_dirlist, kXR_dstat, XrdCl::DirListFlags::Merge, ClientDirlistRequest::options, XrdCl::MessageUtils::ProcessSendParams(), XrdCl::DirListFlags::Recursive, ClientDirlistRequest::requestid, XrdCl::FileSystemData::Send(), XrdCl::XRootDTransport::SetDescription(), XrdCl::DirListFlags::Stat, Stat(), XrdCl::MessageSendParams::timeout, and XrdCl::DirListFlags::Zip.

Referenced by DirList(), DoLS(), IndexRemote(), and XrdPosixDir::Open().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetProperty()

bool XrdCl::FileSystem::GetProperty ( const std::string &  name,
std::string &  value 
) const

Get filesystem property

See also
FileSystem::SetProperty for property list

Definition at line 2175 of file XrdClFileSystem.cc.

2177  {
2178  if( pPlugIn )
2179  return pPlugIn->GetProperty( name, value );
2180 
2181  if( name == "FollowRedirects" )
2182  {
2183  if( pImpl->fsdata->pFollowRedirects ) value = "true";
2184  else value = "false";
2185  return true;
2186  }
2187  else if( name == "LastURL" )
2188  {
2189  if( pImpl->fsdata->pLastUrl )
2190  {
2191  value = pImpl->fsdata->pLastUrl->GetURL();
2192  return true;
2193  }
2194  else return false;
2195  }
2196 
2197  return false;
2198  }
virtual bool GetProperty(const std::string &name, std::string &value) const

References XrdCl::FileSystemImpl::fsdata, and XrdCl::FileSystemPlugIn::GetProperty().

Referenced by DoLS().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetXAttr() [1/2]

XRootDStatus XrdCl::FileSystem::GetXAttr ( const std::string &  path,
const std::vector< std::string > &  attrs,
ResponseHandler handler,
uint16_t  timeout = 0 
)

Get extended attributes - async

Parameters
attrs: list of extended attributes to get
handler: handler to be notified when the response arrives, the response parameter will hold a std::vector of XAttr objects
timeout: timeout value, if 0 the environment default will be used
Returns
: status of the operation

Definition at line 2052 of file XrdClFileSystem.cc.

2056  {
2057  if( pPlugIn )
2059 
2060  return XAttrOperationImpl( kXR_fattrGet, 0, path, attrs, handler, timeout );
2061  }
@ kXR_fattrGet
Definition: XProtocol.hh:271

References XrdCl::errNotSupported, kXR_fattrGet, and XrdCl::stError.

Referenced by DoXAttr(), and GetXAttr().

+ Here is the caller graph for this function:

◆ GetXAttr() [2/2]

XRootDStatus XrdCl::FileSystem::GetXAttr ( const std::string &  path,
const std::vector< std::string > &  attrs,
std::vector< XAttr > &  result,
uint16_t  timeout = 0 
)

Get extended attributes - sync

Parameters
attrs: list of extended attributes to get
result: result of the operation
timeout: timeout value, if 0 the environment default will be used
Returns
: status of the operation

Definition at line 2066 of file XrdClFileSystem.cc.

2070  {
2071  SyncResponseHandler handler;
2072  XRootDStatus st = GetXAttr( path, attrs, &handler, timeout );
2073  if( !st.IsOK() )
2074  return st;
2075 
2076  std::vector<XAttr> *resp = 0;
2077  st = MessageUtils::WaitForResponse( &handler, resp );
2078  if( resp ) result.swap( *resp );
2079  delete resp;
2080 
2081  return st;
2082  }
XRootDStatus GetXAttr(const std::string &path, const std::vector< std::string > &attrs, ResponseHandler *handler, uint16_t timeout=0)

References GetXAttr(), XrdCl::Status::IsOK(), and XrdCl::MessageUtils::WaitForResponse().

+ Here is the call graph for this function:

◆ ListXAttr() [1/2]

XRootDStatus XrdCl::FileSystem::ListXAttr ( const std::string &  path,
ResponseHandler handler,
uint16_t  timeout = 0 
)

List extended attributes - async

Parameters
handler: handler to be notified when the response arrives, the response parameter will hold a std::vector of XAttr objects
timeout: timeout value, if 0 the environment default will be used
Returns
: status of the operation

Definition at line 2122 of file XrdClFileSystem.cc.

2125  {
2126  if( pPlugIn )
2128 
2129  static const std::vector<std::string> nothing;
2130  return XAttrOperationImpl( kXR_fattrList, ClientFattrRequest::aData,
2131  path, nothing, handler, timeout );
2132  }
@ kXR_fattrList
Definition: XProtocol.hh:272
static const int aData
Definition: XProtocol.hh:298

References ClientFattrRequest::aData, XrdCl::errNotSupported, kXR_fattrList, and XrdCl::stError.

Referenced by DoXAttr(), and ListXAttr().

+ Here is the caller graph for this function:

◆ ListXAttr() [2/2]

XRootDStatus XrdCl::FileSystem::ListXAttr ( const std::string &  path,
std::vector< XAttr > &  result,
uint16_t  timeout = 0 
)

List extended attributes - sync

Parameters
result: result of the operation
timeout: timeout value, if 0 the environment default will be used
Returns
: status of the operation

Definition at line 2137 of file XrdClFileSystem.cc.

2140  {
2141  SyncResponseHandler handler;
2142  XRootDStatus st = ListXAttr( path, &handler, timeout );
2143  if( !st.IsOK() )
2144  return st;
2145 
2146  std::vector<XAttr> *resp = 0;
2147  st = MessageUtils::WaitForResponse( &handler, resp );
2148  if( resp ) result.swap( *resp );
2149  delete resp;
2150 
2151  return st;
2152  }
XRootDStatus ListXAttr(const std::string &path, ResponseHandler *handler, uint16_t timeout=0)

References XrdCl::Status::IsOK(), ListXAttr(), and XrdCl::MessageUtils::WaitForResponse().

+ Here is the call graph for this function:

◆ Locate() [1/2]

XRootDStatus XrdCl::FileSystem::Locate ( const std::string &  path,
OpenFlags::Flags  flags,
LocationInfo *&  response,
uint16_t  timeout = 0 
)

Locate a file - sync

Parameters
pathpath to the file to be located
flagssome of the OpenFlags::Flags
responsethe response (to be deleted by the user)
timeouttimeout value, if 0 the environment default will be used
Returns
status of the operation

Definition at line 1157 of file XrdClFileSystem.cc.

1161  {
1162  SyncResponseHandler handler;
1163  Status st = Locate( path, flags, &handler, timeout );
1164  if( !st.IsOK() )
1165  return st;
1166 
1167  return MessageUtils::WaitForResponse( &handler, response );
1168  }

References XrdCl::Status::IsOK(), Locate(), and XrdCl::MessageUtils::WaitForResponse().

+ Here is the call graph for this function:

◆ Locate() [2/2]

XRootDStatus XrdCl::FileSystem::Locate ( const std::string &  path,
OpenFlags::Flags  flags,
ResponseHandler handler,
uint16_t  timeout = 0 
)

Locate a file - async

Parameters
pathpath to the file to be located
flagssome of the OpenFlags::Flags
handlerhandler to be notified when the response arrives, the response parameter will hold a Buffer object if the procedure is successful
timeouttimeout value, if 0 the environment default will be used
Returns
status of the operation

Definition at line 1128 of file XrdClFileSystem.cc.

1132  {
1133  if( pPlugIn )
1134  return pPlugIn->Locate( path, flags, handler, timeout );
1135 
1136  std::string fPath = FilterXrdClCgi( path );
1137 
1138  Message *msg;
1139  ClientLocateRequest *req;
1140  MessageUtils::CreateRequest( msg, req, fPath.length() );
1141 
1142  req->requestid = kXR_locate;
1143  req->options = flags;
1144  req->dlen = fPath.length();
1145  msg->Append( fPath.c_str(), fPath.length(), 24 );
1146  MessageSendParams params; params.timeout = timeout;
1148 
1150 
1151  return FileSystemData::Send( pImpl->fsdata, msg, handler, params );
1152  }
kXR_unt16 requestid
Definition: XProtocol.hh:345
@ kXR_locate
Definition: XProtocol.hh:139
virtual XRootDStatus Locate(const std::string &path, OpenFlags::Flags flags, ResponseHandler *handler, uint16_t timeout)

References XrdCl::Buffer::Append(), XrdCl::MessageUtils::CreateRequest(), ClientLocateRequest::dlen, XrdCl::FileSystemImpl::fsdata, kXR_locate, XrdCl::FileSystemPlugIn::Locate(), ClientLocateRequest::options, XrdCl::MessageUtils::ProcessSendParams(), ClientLocateRequest::requestid, XrdCl::FileSystemData::Send(), XrdCl::XRootDTransport::SetDescription(), and XrdCl::MessageSendParams::timeout.

Referenced by DeepLocate(), DirList(), DoLocate(), and Locate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MkDir() [1/2]

XRootDStatus XrdCl::FileSystem::MkDir ( const std::string &  path,
MkDirFlags::Flags  flags,
Access::Mode  mode,
ResponseHandler handler,
uint16_t  timeout = 0 
)

Create a directory - async

Parameters
pathpath to the directory
flagsor'd MkDirFlags
modeaccess mode, or'd Access::Mode
handlerhandler to be notified when the response arrives
timeouttimeout value, if 0 the environment default will be used
Returns
status of the operation

Definition at line 1376 of file XrdClFileSystem.cc.

1381  {
1382  if( pPlugIn )
1383  return pPlugIn->MkDir( path, flags, mode, handler, timeout );
1384 
1385  std::string fPath = FilterXrdClCgi( path );
1386 
1387  Message *msg;
1388  ClientMkdirRequest *req;
1389  MessageUtils::CreateRequest( msg, req, fPath.length() );
1390 
1391  req->requestid = kXR_mkdir;
1392  req->options[0] = flags;
1393  req->mode = mode;
1394  req->dlen = fPath.length();
1395  msg->Append( fPath.c_str(), fPath.length(), 24 );
1396  MessageSendParams params; params.timeout = timeout;
1399 
1400  return FileSystemData::Send( pImpl->fsdata, msg, handler, params );
1401  }
@ kXR_mkdir
Definition: XProtocol.hh:120
kXR_unt16 requestid
Definition: XProtocol.hh:415
kXR_char options[1]
Definition: XProtocol.hh:416
virtual XRootDStatus MkDir(const std::string &path, MkDirFlags::Flags flags, Access::Mode mode, ResponseHandler *handler, uint16_t timeout)

References XrdCl::Buffer::Append(), XrdCl::MessageUtils::CreateRequest(), ClientMkdirRequest::dlen, XrdCl::FileSystemImpl::fsdata, kXR_mkdir, XrdCl::FileSystemPlugIn::MkDir(), ClientMkdirRequest::mode, ClientMkdirRequest::options, XrdCl::MessageUtils::ProcessSendParams(), ClientMkdirRequest::requestid, XrdCl::FileSystemData::Send(), XrdCl::XRootDTransport::SetDescription(), and XrdCl::MessageSendParams::timeout.

Referenced by DoMkDir(), XrdPosixXrootd::Mkdir(), and MkDir().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MkDir() [2/2]

XRootDStatus XrdCl::FileSystem::MkDir ( const std::string &  path,
MkDirFlags::Flags  flags,
Access::Mode  mode,
uint16_t  timeout = 0 
)

Create a directory - sync

Parameters
pathpath to the directory
flagsor'd MkDirFlags
modeaccess mode, or'd Access::Mode
timeouttimeout value, if 0 the environment default will be used
Returns
status of the operation

Definition at line 1406 of file XrdClFileSystem.cc.

1410  {
1411  SyncResponseHandler handler;
1412  Status st = MkDir( path, flags, mode, &handler, timeout );
1413  if( !st.IsOK() )
1414  return st;
1415 
1416  return MessageUtils::WaitForStatus( &handler );
1417  }
XRootDStatus MkDir(const std::string &path, MkDirFlags::Flags flags, Access::Mode mode, ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT

References XrdCl::Status::IsOK(), MkDir(), and XrdCl::MessageUtils::WaitForStatus().

+ Here is the call graph for this function:

◆ Mv() [1/2]

XRootDStatus XrdCl::FileSystem::Mv ( const std::string &  source,
const std::string &  dest,
ResponseHandler handler,
uint16_t  timeout = 0 
)

Move a directory or a file - async

Parameters
sourcethe file or directory to be moved
destthe new name
handlerhandler to be notified when the response arrives,
timeouttimeout value, if 0 the environment default will be used
Returns
status of the operation

Definition at line 1201 of file XrdClFileSystem.cc.

1205  {
1206  if( pPlugIn )
1207  return pPlugIn->Mv( source, dest, handler, timeout );
1208 
1209  std::string fSource = FilterXrdClCgi( source );
1210  std::string fDest = FilterXrdClCgi( dest );
1211 
1212  Message *msg;
1213  ClientMvRequest *req;
1214  MessageUtils::CreateRequest( msg, req, fSource.length() + fDest.length()+1 );
1215 
1216  req->requestid = kXR_mv;
1217  req->dlen = fSource.length() + fDest.length()+1;
1218  req->arg1len = fSource.length();
1219  msg->Append( fSource.c_str(), fSource.length(), 24 );
1220  *msg->GetBuffer(24 + fSource.length()) = ' ';
1221  msg->Append( fDest.c_str(), fDest.length(), 25 + fSource.length() );
1222  MessageSendParams params; params.timeout = timeout;
1224 
1226 
1227  return FileSystemData::Send( pImpl->fsdata, msg, handler, params );
1228  }
kXR_int16 arg1len
Definition: XProtocol.hh:430
kXR_int32 dlen
Definition: XProtocol.hh:431
kXR_unt16 requestid
Definition: XProtocol.hh:428
@ kXR_mv
Definition: XProtocol.hh:121
const char * GetBuffer(uint32_t offset=0) const
Get the message buffer.
Definition: XrdClBuffer.hh:72
virtual XRootDStatus Mv(const std::string &source, const std::string &dest, ResponseHandler *handler, uint16_t timeout)

References XrdCl::Buffer::Append(), ClientMvRequest::arg1len, XrdCl::MessageUtils::CreateRequest(), ClientMvRequest::dlen, XrdCl::FileSystemImpl::fsdata, XrdCl::Buffer::GetBuffer(), kXR_mv, XrdCl::FileSystemPlugIn::Mv(), XrdCl::MessageUtils::ProcessSendParams(), ClientMvRequest::requestid, XrdCl::FileSystemData::Send(), XrdCl::XRootDTransport::SetDescription(), and XrdCl::MessageSendParams::timeout.

Referenced by DoMv(), Mv(), and XrdPosixXrootd::Rename().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Mv() [2/2]

XRootDStatus XrdCl::FileSystem::Mv ( const std::string &  source,
const std::string &  dest,
uint16_t  timeout = 0 
)

Move a directory or a file - sync

Parameters
sourcethe file or directory to be moved
destthe new name
timeouttimeout value, if 0 the environment default will be used
Returns
status of the operation

Definition at line 1233 of file XrdClFileSystem.cc.

1236  {
1237  SyncResponseHandler handler;
1238  Status st = Mv( source, dest, &handler, timeout );
1239  if( !st.IsOK() )
1240  return st;
1241 
1242  return MessageUtils::WaitForStatus( &handler );
1243  }
XRootDStatus Mv(const std::string &source, const std::string &dest, ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT

References XrdCl::Status::IsOK(), Mv(), and XrdCl::MessageUtils::WaitForStatus().

+ Here is the call graph for this function:

◆ Ping() [1/2]

XRootDStatus XrdCl::FileSystem::Ping ( ResponseHandler handler,
uint16_t  timeout = 0 
)

Check if the server is alive - async

Parameters
handlerhandler to be notified when the response arrives
timeouttimeout value, if 0 the environment default will be used
Returns
status of the operation

Definition at line 1505 of file XrdClFileSystem.cc.

1507  {
1508  if( pPlugIn )
1509  return pPlugIn->Ping( handler, timeout );
1510 
1511  Message *msg;
1512  ClientPingRequest *req;
1513  MessageUtils::CreateRequest( msg, req );
1514 
1515  req->requestid = kXR_ping;
1516  MessageSendParams params; params.timeout = timeout;
1519 
1520  return FileSystemData::Send( pImpl->fsdata, msg, handler, params );
1521  }
kXR_unt16 requestid
Definition: XProtocol.hh:546
@ kXR_ping
Definition: XProtocol.hh:123
virtual XRootDStatus Ping(ResponseHandler *handler, uint16_t timeout)

References XrdCl::MessageUtils::CreateRequest(), XrdCl::FileSystemImpl::fsdata, kXR_ping, XrdCl::FileSystemPlugIn::Ping(), XrdCl::MessageUtils::ProcessSendParams(), ClientPingRequest::requestid, XrdCl::FileSystemData::Send(), XrdCl::XRootDTransport::SetDescription(), and XrdCl::MessageSendParams::timeout.

Referenced by Ping().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Ping() [2/2]

XRootDStatus XrdCl::FileSystem::Ping ( uint16_t  timeout = 0)

Check if the server is alive - sync

Parameters
timeouttimeout value, if 0 the environment default will be used
Returns
status of the operation

Definition at line 1526 of file XrdClFileSystem.cc.

1527  {
1528  SyncResponseHandler handler;
1529  Status st = Ping( &handler, timeout );
1530  if( !st.IsOK() )
1531  return st;
1532 
1533  return MessageUtils::WaitForStatus( &handler );
1534  }
XRootDStatus Ping(ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT

References XrdCl::Status::IsOK(), Ping(), and XrdCl::MessageUtils::WaitForStatus().

+ Here is the call graph for this function:

◆ Prepare() [1/2]

XRootDStatus XrdCl::FileSystem::Prepare ( const std::vector< std::string > &  fileList,
PrepareFlags::Flags  flags,
uint8_t  priority,
Buffer *&  response,
uint16_t  timeout = 0 
)

Prepare one or more files for access - sync

Parameters
fileListlist of files to be prepared
flagsPrepareFlags::Flags
prioritypriority of the request 0 (lowest) - 3 (highest)
responsethe response (to be deleted by the user)
timeouttimeout value, if 0 the environment default will be used
Returns
status of the operation

Definition at line 2000 of file XrdClFileSystem.cc.

2005  {
2006  SyncResponseHandler handler;
2007  Status st = Prepare( fileList, flags, priority, &handler, timeout );
2008  if( !st.IsOK() )
2009  return st;
2010 
2011  return MessageUtils::WaitForResponse( &handler, response );
2012  }
XRootDStatus Prepare(const std::vector< std::string > &fileList, PrepareFlags::Flags flags, uint8_t priority, ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT

References XrdCl::Status::IsOK(), Prepare(), and XrdCl::MessageUtils::WaitForResponse().

+ Here is the call graph for this function:

◆ Prepare() [2/2]

XRootDStatus XrdCl::FileSystem::Prepare ( const std::vector< std::string > &  fileList,
PrepareFlags::Flags  flags,
uint8_t  priority,
ResponseHandler handler,
uint16_t  timeout = 0 
)

Prepare one or more files for access - async

Parameters
fileListlist of files to be prepared
flagsPrepareFlags::Flags
prioritypriority of the request 0 (lowest) - 3 (highest)
handlerhandler to be notified when the response arrives, the response parameter will hold a Buffer object if the procedure is successful
timeouttimeout value, if 0 the environment default will be used
Returns
status of the operation

Definition at line 1960 of file XrdClFileSystem.cc.

1965  {
1966  if( pPlugIn )
1967  return pPlugIn->Prepare( fileList, flags, priority, handler, timeout );
1968 
1969  std::vector<std::string>::const_iterator it;
1970  std::string list;
1971  for( it = fileList.begin(); it != fileList.end(); ++it )
1972  {
1973  list += *it;
1974  list += "\n";
1975  }
1976  list.erase( list.length()-1, 1 );
1977 
1978  Message *msg;
1979  ClientPrepareRequest *req;
1980  MessageUtils::CreateRequest( msg, req, list.length() );
1981 
1982  req->requestid = kXR_prepare;
1983  req->options = 0xff & flags;
1984  req->optionX = 0xffff & ( flags >> 8 );
1985  req->prty = priority;
1986  req->dlen = list.length();
1987 
1988  msg->Append( list.c_str(), list.length(), 24 );
1989 
1990  MessageSendParams params; params.timeout = timeout;
1993 
1994  return FileSystemData::Send( pImpl->fsdata, msg, handler, params );
1995  }
@ kXR_prepare
Definition: XProtocol.hh:133
virtual XRootDStatus Prepare(const std::vector< std::string > &fileList, PrepareFlags::Flags flags, uint8_t priority, ResponseHandler *handler, uint16_t timeout)

References XrdCl::Buffer::Append(), XrdCl::MessageUtils::CreateRequest(), ClientPrepareRequest::dlen, XrdCl::FileSystemImpl::fsdata, kXR_prepare, ClientPrepareRequest::options, ClientPrepareRequest::optionX, XrdCl::FileSystemPlugIn::Prepare(), XrdCl::MessageUtils::ProcessSendParams(), ClientPrepareRequest::prty, ClientPrepareRequest::requestid, XrdCl::FileSystemData::Send(), XrdCl::XRootDTransport::SetDescription(), and XrdCl::MessageSendParams::timeout.

Referenced by DoPrepare(), and Prepare().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Protocol() [1/2]

XRootDStatus XrdCl::FileSystem::Protocol ( ProtocolInfo *&  response,
uint16_t  timeout = 0 
)

Obtain server protocol information - sync

Parameters
responsethe response (to be deleted by the user)
timeouttimeout value, if 0 the environment default will be used
Returns
status of the operation

Definition at line 1648 of file XrdClFileSystem.cc.

1650  {
1651  SyncResponseHandler handler;
1652  Status st = Protocol( &handler, timeout );
1653  if( !st.IsOK() )
1654  return st;
1655 
1656  return MessageUtils::WaitForResponse( &handler, response );
1657  }
XRootDStatus Protocol(ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT

References XrdCl::Status::IsOK(), Protocol(), and XrdCl::MessageUtils::WaitForResponse().

+ Here is the call graph for this function:

◆ Protocol() [2/2]

XRootDStatus XrdCl::FileSystem::Protocol ( ResponseHandler handler,
uint16_t  timeout = 0 
)

Obtain server protocol information - async

Parameters
handlerhandler to be notified when the response arrives, the response parameter will hold a ProtocolInfo object if the procedure is successful
timeouttimeout value, if 0 the environment default will be used
Returns
status of the operation

Definition at line 1626 of file XrdClFileSystem.cc.

1628  {
1629  if( pPlugIn )
1630  return pPlugIn->Protocol( handler, timeout );
1631 
1632  Message *msg;
1633  ClientProtocolRequest *req;
1634  MessageUtils::CreateRequest( msg, req );
1635 
1636  req->requestid = kXR_protocol;
1638  MessageSendParams params; params.timeout = timeout;
1641 
1642  return FileSystemData::Send( pImpl->fsdata, msg, handler, params );
1643  }
@ kXR_protocol
Definition: XProtocol.hh:118
#define kXR_PROTOCOLVERSION
Definition: XProtocol.hh:70
virtual XRootDStatus Protocol(ResponseHandler *handler, uint16_t timeout=0)

References ClientProtocolRequest::clientpv, XrdCl::MessageUtils::CreateRequest(), XrdCl::FileSystemImpl::fsdata, kXR_protocol, kXR_PROTOCOLVERSION, XrdCl::MessageUtils::ProcessSendParams(), XrdCl::FileSystemPlugIn::Protocol(), ClientProtocolRequest::requestid, XrdCl::FileSystemData::Send(), XrdCl::XRootDTransport::SetDescription(), and XrdCl::MessageSendParams::timeout.

Referenced by Protocol().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Query() [1/2]

XRootDStatus XrdCl::FileSystem::Query ( QueryCode::Code  queryCode,
const Buffer arg,
Buffer *&  response,
uint16_t  timeout = 0 
)

Obtain server information - sync

Parameters
queryCodethe query code as specified in the QueryCode struct
argquery argument
responsethe response (to be deleted by the user)
timeouttimeout value, if 0 the environment default will be used
Returns
status of the operation

Definition at line 1274 of file XrdClFileSystem.cc.

1278  {
1279  SyncResponseHandler handler;
1280  Status st = Query( queryCode, arg, &handler, timeout );
1281  if( !st.IsOK() )
1282  return st;
1283 
1284  return MessageUtils::WaitForResponse( &handler, response );
1285  }
XRootDStatus Query(QueryCode::Code queryCode, const Buffer &arg, ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT

References XrdCl::Status::IsOK(), Query(), and XrdCl::MessageUtils::WaitForResponse().

+ Here is the call graph for this function:

◆ Query() [2/2]

XRootDStatus XrdCl::FileSystem::Query ( QueryCode::Code  queryCode,
const Buffer arg,
ResponseHandler handler,
uint16_t  timeout = 0 
)

Obtain server information - async

Parameters
queryCodethe query code as specified in the QueryCode struct
argquery argument
handlerhandler to be notified when the response arrives, the response parameter will hold a Buffer object if the procedure is successful
timeouttimeout value, if 0 the environment default will be used
Returns
status of the operation

Definition at line 1248 of file XrdClFileSystem.cc.

1252  {
1253  if( pPlugIn )
1254  return pPlugIn->Query( queryCode, arg, handler, timeout );
1255 
1256  Message *msg;
1257  ClientQueryRequest *req;
1258  MessageUtils::CreateRequest( msg, req, arg.GetSize() );
1259 
1260  req->requestid = kXR_query;
1261  req->infotype = queryCode;
1262  req->dlen = arg.GetSize();
1263  msg->Append( arg.GetBuffer(), arg.GetSize(), 24 );
1264  MessageSendParams params; params.timeout = timeout;
1267 
1268  return FileSystemData::Send( pImpl->fsdata, msg, handler, params );
1269  }
kXR_unt16 requestid
Definition: XProtocol.hh:630
kXR_unt16 infotype
Definition: XProtocol.hh:631
@ kXR_query
Definition: XProtocol.hh:113
uint32_t GetSize() const
Get the size of the message.
Definition: XrdClBuffer.hh:132
virtual XRootDStatus Query(QueryCode::Code queryCode, const Buffer &arg, ResponseHandler *handler, uint16_t timeout)

References XrdCl::Buffer::Append(), XrdCl::MessageUtils::CreateRequest(), ClientQueryRequest::dlen, XrdCl::FileSystemImpl::fsdata, XrdCl::Buffer::GetBuffer(), XrdCl::Buffer::GetSize(), ClientQueryRequest::infotype, kXR_query, XrdCl::MessageUtils::ProcessSendParams(), XrdCl::FileSystemPlugIn::Query(), ClientQueryRequest::requestid, XrdCl::FileSystemData::Send(), XrdCl::XRootDTransport::SetDescription(), and XrdCl::MessageSendParams::timeout.

Referenced by XrdCl::Utils::CheckTPC(), XrdCl::Utils::CheckTPCLite(), XrdCl::EcHandler::Close(), DoQuery(), XrdCl::Utils::GetRemoteCheckSum(), XrdCl::FileSystemUtils::GetSpaceInfo(), XrdCl::Utils::GetSupportedCheckSums(), and Query().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Rm() [1/2]

XRootDStatus XrdCl::FileSystem::Rm ( const std::string &  path,
ResponseHandler handler,
uint16_t  timeout = 0 
)

Remove a file - async

Parameters
pathpath to the file to be removed
handlerhandler to be notified when the response arrives
timeouttimeout value, if 0 the environment default will be used
Returns
status of the operation

Definition at line 1333 of file XrdClFileSystem.cc.

1336  {
1337  if( pPlugIn )
1338  return pPlugIn->Rm( path, handler, timeout );
1339 
1340  if( pImpl->fsdata->pUrl->IsLocalFile() )
1341  return LocalFS::Instance().Rm( path, handler, timeout );
1342 
1343  std::string fPath = FilterXrdClCgi( path );
1344 
1345  Message *msg;
1346  ClientRmRequest *req;
1347  MessageUtils::CreateRequest( msg, req, fPath.length() );
1348 
1349  req->requestid = kXR_rm;
1350  req->dlen = fPath.length();
1351  msg->Append( fPath.c_str(), fPath.length(), 24 );
1352  MessageSendParams params; params.timeout = timeout;
1355 
1356  return FileSystemData::Send( pImpl->fsdata, msg, handler, params );
1357  }
@ kXR_rm
Definition: XProtocol.hh:126
kXR_int32 dlen
Definition: XProtocol.hh:697
kXR_unt16 requestid
Definition: XProtocol.hh:695
virtual XRootDStatus Rm(const std::string &path, ResponseHandler *handler, uint16_t timeout)

References XrdCl::Buffer::Append(), XrdCl::MessageUtils::CreateRequest(), ClientRmRequest::dlen, XrdCl::FileSystemImpl::fsdata, kXR_rm, XrdCl::MessageUtils::ProcessSendParams(), ClientRmRequest::requestid, XrdCl::FileSystemPlugIn::Rm(), XrdCl::FileSystemData::Send(), XrdCl::XRootDTransport::SetDescription(), and XrdCl::MessageSendParams::timeout.

Referenced by Rm(), XrdCl::ClassicCopyJob::Run(), and XrdPosixXrootd::Unlink().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Rm() [2/2]

XRootDStatus XrdCl::FileSystem::Rm ( const std::string &  path,
uint16_t  timeout = 0 
)

Remove a file - sync

Parameters
pathpath to the file to be removed
timeouttimeout value, if 0 the environment default will be used
Returns
status of the operation

Definition at line 1362 of file XrdClFileSystem.cc.

1364  {
1365  SyncResponseHandler handler;
1366  Status st = Rm( path, &handler, timeout );
1367  if( !st.IsOK() )
1368  return st;
1369 
1370  return MessageUtils::WaitForStatus( &handler );
1371  }
XRootDStatus Rm(const std::string &path, ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT

References XrdCl::Status::IsOK(), Rm(), and XrdCl::MessageUtils::WaitForStatus().

+ Here is the call graph for this function:

◆ RmDir() [1/2]

XRootDStatus XrdCl::FileSystem::RmDir ( const std::string &  path,
ResponseHandler handler,
uint16_t  timeout = 0 
)

Remove a directory - async

Parameters
pathpath to the directory to be removed
handlerhandler to be notified when the response arrives
timeouttimeout value, if 0 the environment default will be used
Returns
status of the operation

Definition at line 1422 of file XrdClFileSystem.cc.

1425  {
1426  if( pPlugIn )
1427  return pPlugIn->RmDir( path, handler, timeout );
1428 
1429  std::string fPath = FilterXrdClCgi( path );
1430 
1431  Message *msg;
1432  ClientRmdirRequest *req;
1433  MessageUtils::CreateRequest( msg, req, fPath.length() );
1434 
1435  req->requestid = kXR_rmdir;
1436  req->dlen = fPath.length();
1437  msg->Append( fPath.c_str(), fPath.length(), 24 );
1438  MessageSendParams params; params.timeout = timeout;
1441 
1442  return FileSystemData::Send( pImpl->fsdata, msg, handler, params );
1443  }
@ kXR_rmdir
Definition: XProtocol.hh:127
kXR_unt16 requestid
Definition: XProtocol.hh:706
virtual XRootDStatus RmDir(const std::string &path, ResponseHandler *handler, uint16_t timeout)

References XrdCl::Buffer::Append(), XrdCl::MessageUtils::CreateRequest(), ClientRmdirRequest::dlen, XrdCl::FileSystemImpl::fsdata, kXR_rmdir, XrdCl::MessageUtils::ProcessSendParams(), ClientRmdirRequest::requestid, XrdCl::FileSystemPlugIn::RmDir(), XrdCl::FileSystemData::Send(), XrdCl::XRootDTransport::SetDescription(), and XrdCl::MessageSendParams::timeout.

Referenced by DoRmDir(), XrdPosixXrootd::Rmdir(), and RmDir().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RmDir() [2/2]

XRootDStatus XrdCl::FileSystem::RmDir ( const std::string &  path,
uint16_t  timeout = 0 
)

Remove a directory - sync

Parameters
pathpath to the directory to be removed
timeouttimeout value, if 0 the environment default will be used
Returns
status of the operation

Definition at line 1448 of file XrdClFileSystem.cc.

1450  {
1451  SyncResponseHandler handler;
1452  Status st = RmDir( path, &handler, timeout );
1453  if( !st.IsOK() )
1454  return st;
1455 
1456  return MessageUtils::WaitForStatus( &handler );
1457  }
XRootDStatus RmDir(const std::string &path, ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT

References XrdCl::Status::IsOK(), RmDir(), and XrdCl::MessageUtils::WaitForStatus().

+ Here is the call graph for this function:

◆ SendCache() [1/2]

XRootDStatus XrdCl::FileSystem::SendCache ( const std::string &  info,
Buffer *&  response,
uint16_t  timeout = 0 
)

Send cache info to the server - sync.

Send cache into the server - sync

Parameters
infothe info string to be sent
responsethe response (to be deleted by the user)
timeouttimeout value, if 0 the environment default will be used
Returns
status of the operation

Definition at line 1893 of file XrdClFileSystem.cc.

1896  {
1897  SyncResponseHandler handler;
1898  Status st = SendCache( info, &handler, timeout );
1899  if( !st.IsOK() )
1900  return st;
1901 
1902  return MessageUtils::WaitForResponse( &handler, response );
1903  }
XRootDStatus SendCache(const std::string &info, ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT

References XrdCl::Status::IsOK(), SendCache(), and XrdCl::MessageUtils::WaitForResponse().

+ Here is the call graph for this function:

◆ SendCache() [2/2]

XRootDStatus XrdCl::FileSystem::SendCache ( const std::string &  info,
ResponseHandler handler,
uint16_t  timeout = 0 
)

Send cache into the server - async

Parameters
infothe info string to be sent
handlerhandler to be notified when the response arrives, the response parameter will hold a Buffer object if the procedure is successful
timeouttimeout value, if 0 the environment default will be used
Returns
status of the operation

Definition at line 1879 of file XrdClFileSystem.cc.

1882  {
1883  // Note: adding SendCache() to the FileSystemPlugin class breaks ABI!
1884  // So, the class is missing this until we do a major release. TODO
1885  //if( pPlugIn )
1886  // return pPlugIn->SendCache( info, handler, timeout );
1887  return SendSet("cache ", info, handler, timeout );
1888  }

Referenced by DoCache(), and SendCache().

+ Here is the caller graph for this function:

◆ SendInfo() [1/2]

XRootDStatus XrdCl::FileSystem::SendInfo ( const std::string &  info,
Buffer *&  response,
uint16_t  timeout = 0 
)

Send info to the server - sync.

Send info to the server (up to 1024 characters) - sync

Parameters
infothe info string to be sent
responsethe response (to be deleted by the user)
timeouttimeout value, if 0 the environment default will be used
Returns
status of the operation

Definition at line 1920 of file XrdClFileSystem.cc.

1923  {
1924  SyncResponseHandler handler;
1925  Status st = SendInfo( info, &handler, timeout );
1926  if( !st.IsOK() )
1927  return st;
1928 
1929  return MessageUtils::WaitForResponse( &handler, response );
1930  }
XRootDStatus SendInfo(const std::string &info, ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT

References XrdCl::Status::IsOK(), SendInfo(), and XrdCl::MessageUtils::WaitForResponse().

+ Here is the call graph for this function:

◆ SendInfo() [2/2]

XRootDStatus XrdCl::FileSystem::SendInfo ( const std::string &  info,
ResponseHandler handler,
uint16_t  timeout = 0 
)

Send info to the server (up to 1024 characters)- async

Parameters
infothe info string to be sent
handlerhandler to be notified when the response arrives, the response parameter will hold a Buffer object if the procedure is successful
timeouttimeout value, if 0 the environment default will be used
Returns
status of the operation

Definition at line 1908 of file XrdClFileSystem.cc.

1911  {
1912  if( pPlugIn )
1913  return pPlugIn->SendInfo( info, handler, timeout );
1914  return SendSet("monitor info ", info, handler, timeout );
1915  }
virtual XRootDStatus SendInfo(const std::string &info, ResponseHandler *handler, uint16_t timeout)

References XrdCl::FileSystemPlugIn::SendInfo().

Referenced by SendInfo().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetProperty()

bool XrdCl::FileSystem::SetProperty ( const std::string &  name,
const std::string &  value 
)

Set filesystem property

Filesystem properties: FollowRedirects [true/false] - enable/disable following redirections

Definition at line 2157 of file XrdClFileSystem.cc.

2159  {
2160  if( pPlugIn )
2161  return pPlugIn->SetProperty( name, value );
2162 
2163  if( name == "FollowRedirects" )
2164  {
2165  if( value == "true" ) pImpl->fsdata->pFollowRedirects = true;
2166  else pImpl->fsdata->pFollowRedirects = false;
2167  return true;
2168  }
2169  return false;
2170  }
virtual bool SetProperty(const std::string &name, const std::string &value)

References XrdCl::FileSystemImpl::fsdata, and XrdCl::FileSystemPlugIn::SetProperty().

+ Here is the call graph for this function:

◆ SetXAttr() [1/2]

XRootDStatus XrdCl::FileSystem::SetXAttr ( const std::string &  path,
const std::vector< xattr_t > &  attrs,
ResponseHandler handler,
uint16_t  timeout = 0 
)

Set extended attributes - async

Parameters
attrs: list of extended attributes to set
handler: handler to be notified when the response arrives, the response parameter will hold a std::vector of XAttrStatus objects
timeout: timeout value, if 0 the environment default will be used
Returns
: status of the operation

Definition at line 2017 of file XrdClFileSystem.cc.

2021  {
2022  if( pPlugIn )
2024 
2025  return XAttrOperationImpl( kXR_fattrSet, 0, path, attrs, handler, timeout );
2026  }
@ kXR_fattrSet
Definition: XProtocol.hh:273

References XrdCl::errNotSupported, kXR_fattrSet, and XrdCl::stError.

Referenced by DoXAttr(), and SetXAttr().

+ Here is the caller graph for this function:

◆ SetXAttr() [2/2]

XRootDStatus XrdCl::FileSystem::SetXAttr ( const std::string &  path,
const std::vector< xattr_t > &  attrs,
std::vector< XAttrStatus > &  result,
uint16_t  timeout = 0 
)

Set extended attributes - sync

Parameters
attrs: list of extended attributes to set
result: result of the operation
timeout: timeout value, if 0 the environment default will be used
Returns
: status of the operation

Definition at line 2031 of file XrdClFileSystem.cc.

2035  {
2036  SyncResponseHandler handler;
2037  XRootDStatus st = SetXAttr( path, attrs, &handler, timeout );
2038  if( !st.IsOK() )
2039  return st;
2040 
2041  std::vector<XAttrStatus> *resp = 0;
2042  st = MessageUtils::WaitForResponse( &handler, resp );
2043  if( resp ) result.swap( *resp );
2044  delete resp;
2045 
2046  return st;
2047  }
XRootDStatus SetXAttr(const std::string &path, const std::vector< xattr_t > &attrs, ResponseHandler *handler, uint16_t timeout=0)

References XrdCl::Status::IsOK(), SetXAttr(), and XrdCl::MessageUtils::WaitForResponse().

+ Here is the call graph for this function:

◆ Stat() [1/2]

XRootDStatus XrdCl::FileSystem::Stat ( const std::string &  path,
ResponseHandler handler,
uint16_t  timeout = 0 
)

Obtain status information for a path - async

Parameters
pathfile/directory path
handlerhandler to be notified when the response arrives, the response parameter will hold a StatInfo object if the procedure is successful
timeouttimeout value, if 0 the environment default will be used
Returns
status of the operation

Definition at line 1539 of file XrdClFileSystem.cc.

1542  {
1543  if( pPlugIn )
1544  return pPlugIn->Stat( path, handler, timeout );
1545 
1546  if( pImpl->fsdata->pUrl->IsLocalFile() )
1547  return LocalFS::Instance().Stat( path, handler, timeout );
1548 
1549  std::string fPath = FilterXrdClCgi( path );
1550 
1551  Message *msg;
1552  ClientStatRequest *req;
1553  MessageUtils::CreateRequest( msg, req, fPath.length() );
1554 
1555  req->requestid = kXR_stat;
1556  req->options = 0;
1557  req->dlen = fPath.length();
1558  msg->Append( fPath.c_str(), fPath.length(), 24 );
1559  MessageSendParams params; params.timeout = timeout;
1562 
1563  return FileSystemData::Send( pImpl->fsdata, msg, handler, params );
1564  }
@ kXR_stat
Definition: XProtocol.hh:129
kXR_unt16 requestid
Definition: XProtocol.hh:766
kXR_int32 dlen
Definition: XProtocol.hh:770
kXR_char options
Definition: XProtocol.hh:767
virtual XRootDStatus Stat(const std::string &path, ResponseHandler *handler, uint16_t timeout)

References XrdCl::Buffer::Append(), XrdCl::MessageUtils::CreateRequest(), ClientStatRequest::dlen, XrdCl::FileSystemImpl::fsdata, kXR_stat, ClientStatRequest::options, XrdCl::MessageUtils::ProcessSendParams(), ClientStatRequest::requestid, XrdCl::FileSystemData::Send(), XrdCl::XRootDTransport::SetDescription(), XrdCl::FileSystemPlugIn::Stat(), and XrdCl::MessageSendParams::timeout.

Referenced by DirList(), DoCD(), DoLS(), main(), and Stat().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Stat() [2/2]

XRootDStatus XrdCl::FileSystem::Stat ( const std::string &  path,
StatInfo *&  response,
uint16_t  timeout = 0 
)

Obtain status information for a path - sync

Parameters
pathfile/directory path
responsethe response (to be deleted by the user only if the procedure is successful)
timeouttimeout value, if 0 the environment default will be used
Returns
status of the operation

Definition at line 1569 of file XrdClFileSystem.cc.

1572  {
1573  SyncResponseHandler handler;
1574  Status st = Stat( path, &handler, timeout );
1575  if( !st.IsOK() )
1576  return st;
1577 
1578  return MessageUtils::WaitForResponse( &handler, response );
1579  }

References XrdCl::Status::IsOK(), Stat(), and XrdCl::MessageUtils::WaitForResponse().

+ Here is the call graph for this function:

◆ StatVFS() [1/2]

XRootDStatus XrdCl::FileSystem::StatVFS ( const std::string &  path,
ResponseHandler handler,
uint16_t  timeout = 0 
)

Obtain status information for a Virtual File System - async

Parameters
pathfile/directory path
handlerhandler to be notified when the response arrives, the response parameter will hold a StatInfoVFS object if the procedure is successful
timeouttimeout value, if 0 the environment default will be used
Returns
status of the operation

Definition at line 1584 of file XrdClFileSystem.cc.

1587  {
1588  if( pPlugIn )
1589  return pPlugIn->StatVFS( path, handler, timeout );
1590 
1591  std::string fPath = FilterXrdClCgi( path );
1592 
1593  Message *msg;
1594  ClientStatRequest *req;
1595  MessageUtils::CreateRequest( msg, req, fPath.length() );
1596 
1597  req->requestid = kXR_stat;
1598  req->options = kXR_vfs;
1599  req->dlen = fPath.length();
1600  msg->Append( fPath.c_str(), fPath.length(), 24 );
1601  MessageSendParams params; params.timeout = timeout;
1604 
1605  return FileSystemData::Send( pImpl->fsdata, msg, handler, params );
1606  }
@ kXR_vfs
Definition: XProtocol.hh:761
virtual XRootDStatus StatVFS(const std::string &path, ResponseHandler *handler, uint16_t timeout)

References XrdCl::Buffer::Append(), XrdCl::MessageUtils::CreateRequest(), ClientStatRequest::dlen, XrdCl::FileSystemImpl::fsdata, kXR_stat, kXR_vfs, ClientStatRequest::options, XrdCl::MessageUtils::ProcessSendParams(), ClientStatRequest::requestid, XrdCl::FileSystemData::Send(), XrdCl::XRootDTransport::SetDescription(), XrdCl::FileSystemPlugIn::StatVFS(), and XrdCl::MessageSendParams::timeout.

Referenced by DoStatVFS(), XrdPosixXrootd::Statvfs(), and StatVFS().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ StatVFS() [2/2]

XRootDStatus XrdCl::FileSystem::StatVFS ( const std::string &  path,
StatInfoVFS *&  response,
uint16_t  timeout = 0 
)

Obtain status information for a Virtual File System - sync

Parameters
pathfile/directory path
responsethe response (to be deleted by the user)
timeouttimeout value, if 0 the environment default will be used
Returns
status of the operation

Definition at line 1611 of file XrdClFileSystem.cc.

1614  {
1615  SyncResponseHandler handler;
1616  Status st = StatVFS( path, &handler, timeout );
1617  if( !st.IsOK() )
1618  return st;
1619 
1620  return MessageUtils::WaitForResponse( &handler, response );
1621  }
XRootDStatus StatVFS(const std::string &path, ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT

References XrdCl::Status::IsOK(), StatVFS(), and XrdCl::MessageUtils::WaitForResponse().

+ Here is the call graph for this function:

◆ Truncate() [1/2]

XRootDStatus XrdCl::FileSystem::Truncate ( const std::string &  path,
uint64_t  size,
ResponseHandler handler,
uint16_t  timeout = 0 
)

Truncate a file - async

Parameters
pathpath to the file to be truncated
sizefile size
handlerhandler to be notified when the response arrives
timeouttimeout value, if 0 the environment default will be used
Returns
status of the operation

Definition at line 1290 of file XrdClFileSystem.cc.

1294  {
1295  if( pPlugIn )
1296  return pPlugIn->Truncate( path, size, handler, timeout );
1297 
1298  std::string fPath = FilterXrdClCgi( path );
1299 
1300  Message *msg;
1301  ClientTruncateRequest *req;
1302  MessageUtils::CreateRequest( msg, req, fPath.length() );
1303 
1304  req->requestid = kXR_truncate;
1305  req->offset = size;
1306  req->dlen = fPath.length();
1307  msg->Append( fPath.c_str(), fPath.length(), 24 );
1308  MessageSendParams params; params.timeout = timeout;
1311 
1312  return FileSystemData::Send( pImpl->fsdata, msg, handler, params );
1313  }
@ kXR_truncate
Definition: XProtocol.hh:140
virtual XRootDStatus Truncate(const std::string &path, uint64_t size, ResponseHandler *handler, uint16_t timeout)

References XrdCl::Buffer::Append(), XrdCl::MessageUtils::CreateRequest(), ClientTruncateRequest::dlen, XrdCl::FileSystemImpl::fsdata, kXR_truncate, ClientTruncateRequest::offset, XrdCl::MessageUtils::ProcessSendParams(), ClientTruncateRequest::requestid, XrdCl::FileSystemData::Send(), XrdCl::XRootDTransport::SetDescription(), XrdCl::MessageSendParams::timeout, and XrdCl::FileSystemPlugIn::Truncate().

Referenced by DoTruncate(), XrdPosixXrootd::Truncate(), and Truncate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Truncate() [2/2]

XRootDStatus XrdCl::FileSystem::Truncate ( const std::string &  path,
uint64_t  size,
uint16_t  timeout = 0 
)

Truncate a file - sync

Parameters
pathpath to the file to be truncated
sizefile size
timeouttimeout value, if 0 the environment default will be used
Returns
status of the operation

Definition at line 1318 of file XrdClFileSystem.cc.

1321  {
1322  SyncResponseHandler handler;
1323  Status st = Truncate( path, size, &handler, timeout );
1324  if( !st.IsOK() )
1325  return st;
1326 
1327  return MessageUtils::WaitForStatus( &handler );
1328  }
XRootDStatus Truncate(const std::string &path, uint64_t size, ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT

References XrdCl::Status::IsOK(), Truncate(), and XrdCl::MessageUtils::WaitForStatus().

+ Here is the call graph for this function:

Friends And Related Function Documentation

◆ AssignLBHandler

friend class AssignLBHandler
friend

Definition at line 204 of file XrdClFileSystem.hh.

◆ ForkHandler

friend class ForkHandler
friend

Definition at line 205 of file XrdClFileSystem.hh.


The documentation for this class was generated from the following files: