XRootD
Loading...
Searching...
No Matches
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.

Public Member Functions

 FileSystem (const URL &url, bool enablePlugIns=true)
 ~FileSystem ()
 Destructor.
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.
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.
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();
1094 PlugInFactory *fact = DefaultEnv::GetPlugInManager()->GetFactory(urlStr);
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", url.GetObfuscatedURL().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)
PlugInFactory * GetFactory(const std::string url)
const uint64_t FileMsg
XrdSysError Log
Definition XrdConfig.cc:112

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

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
static void ProcessSendParams(MessageSendParams &sendParams)
Process sending params.
static void CreateRequest(Message *&msg, Request *&req, uint32_t payloadSize=0)
Create a message.
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)

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

Referenced by 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 }
static XRootDStatus WaitForStatus(SyncResponseHandler *handler)
Wait and return the status of the query.
ChModImpl< false > ChMod

References 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 }
static XrdCl::XRootDStatus WaitForResponse(SyncResponseHandler *handler, Type *&response)
Wait for the response.
DeepLocateImpl< false > DeepLocate

References 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 }
LocateImpl< false > Locate

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

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 2098 of file XrdClFileSystem.cc.

2102 {
2103 if( pPlugIn )
2104 return XRootDStatus( stError, errNotSupported );
2105
2106 return XAttrOperationImpl( kXR_fattrDel, 0, path, attrs, handler, timeout );
2107 }
@ kXR_fattrDel
Definition XProtocol.hh:270
const uint16_t stError
An error occurred that could potentially be retried.
const uint16_t errNotSupported

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 2112 of file XrdClFileSystem.cc.

2116 {
2117 SyncResponseHandler handler;
2118 XRootDStatus st = DelXAttr( path, attrs, &handler, timeout );
2119 if( !st.IsOK() )
2120 return st;
2121
2122 std::vector<XAttrStatus> *resp = 0;
2123 st = MessageUtils::WaitForResponse( &handler, resp );
2124 if( resp ) result.swap( *resp );
2125 delete resp;
2126
2127 return st;
2128 }
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 )
1725 return XRootDStatus( stError, errNotSupported );
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 bool isserver = false;
1741 //------------------------------------------------------------------------
1742 // Check if destination is a data server
1743 //------------------------------------------------------------------------
1744 {
1745 AnyObject obj;
1746 XRootDStatus st = DefaultEnv::GetPostMaster()->QueryTransport(
1747 *pImpl->fsdata->pUrl, XRootDQuery::ServerFlags, obj);
1748
1749 if( st.IsOK() )
1750 {
1751 int *ptr = 0;
1752 obj.Get( ptr );
1753 isserver = ( *ptr & kXR_isServer );
1754 delete ptr;
1755 }
1756 }
1757
1758 if (isserver) {
1759 // Just disable the locate flag if we are talking to a single server
1760 flags &= ~DirListFlags::Locate;
1761 } else {
1762 //------------------------------------------------------------------------
1763 // Locate all the disk servers holding the directory
1764 //------------------------------------------------------------------------
1765 LocationInfo *locations;
1766 std::string locatePath = "*"; locatePath += path;
1767
1768 XRootDStatus st = DeepLocate(locatePath,
1772 locations);
1773
1774 if( !st.IsOK() )
1775 return st;
1776
1777 if( locations->GetSize() == 0 )
1778 {
1779 delete locations;
1780 return XRootDStatus( stError, errNotFound );
1781 }
1782
1783 //------------------------------------------------------------------------
1784 // Ask each server for a directory list
1785 //------------------------------------------------------------------------
1786 flags &= ~DirListFlags::Locate;
1787 FileSystem *fs;
1788 DirectoryList *currentResp = 0;
1789 uint32_t errors = 0;
1790 uint32_t numLocations = locations->GetSize();
1791 bool partial = st.code == suPartial ? true : false;
1792
1793 response = new DirectoryList();
1794 response->SetParentName( path );
1795
1796 for( uint32_t i = 0; i < locations->GetSize(); ++i )
1797 {
1798 URL locationURL( locations->At(i).GetAddress() );
1799 // make sure the original protocol is preserved (root vs roots)
1800 locationURL.SetProtocol( pImpl->fsdata->pUrl->GetProtocol() );
1801 fs = new FileSystem( locationURL );
1802 st = fs->DirList( path, flags, currentResp, timeout );
1803 if( !st.IsOK() )
1804 {
1805 ++errors;
1806 delete fs;
1807 continue;
1808 }
1809
1810 if( st.code == suPartial )
1811 partial = true;
1812
1814
1815 for( it = currentResp->Begin(); it != currentResp->End(); ++it )
1816 {
1817 response->Add( *it );
1818 *it = 0;
1819 }
1820
1821 delete fs;
1822 delete currentResp;
1823 fs = 0;
1824 currentResp = 0;
1825 }
1826
1827 delete locations;
1828
1829 if( flags & DirListFlags::Merge )
1830 MergeDirListHandler::Merge( response );
1831
1832 if( errors || partial )
1833 {
1834 if( errors == numLocations )
1835 return st;
1836 return XRootDStatus( stOK, suPartial );
1837 }
1838 return XRootDStatus();
1839 }
1840 }
1841
1842 //--------------------------------------------------------------------------
1843 // We just ask the current server
1844 //--------------------------------------------------------------------------
1845 SyncResponseHandler handler;
1846 XRootDStatus st = DirList( path, flags, &handler, timeout );
1847 if( !st.IsOK() )
1848 return st;
1849
1850 st = MessageUtils::WaitForResponse( &handler, response );
1851 if( !st.IsOK() )
1852 return st;
1853
1854 //--------------------------------------------------------------------------
1855 // Do the stats on all the entries if necessary.
1856 // If we already have the stat objects it means that the bulk stat has
1857 // succeeded.
1858 //--------------------------------------------------------------------------
1859 if( !(flags & DirListFlags::Stat) )
1860 return st;
1861
1862 if( response->GetSize() && response->At(0)->GetStatInfo() )
1863 return st;
1864
1865 uint32_t quota = response->GetSize() <= 1024 ? response->GetSize() : 1024;
1866 RequestSync sync( response->GetSize(), quota );
1867 for( uint32_t i = 0; i < response->GetSize(); ++i )
1868 {
1869 std::string fullPath = response->GetParentName()+response->At(i)->GetName();
1870 ResponseHandler *handler = new DirListStatHandler( response, i, &sync );
1871 st = Stat( fullPath, handler, timeout );
1872 if( !st.IsOK() )
1873 {
1874 sync.TaskDone( false );
1875 delete handler;
1876 }
1877 sync.WaitForQuota();
1878 }
1879 sync.WaitForAll();
1880
1881 if( sync.FailureCount() )
1882 return XRootDStatus( stOK, suPartial );
1883
1884 return XRootDStatus();
1885 }
#define kXR_isServer
struct stat Stat
Definition XrdCks.cc:49
static PostMaster * GetPostMaster()
Get default post master.
DirList::iterator Iterator
Directory listing iterator.
FileSystem(const URL &url, bool enablePlugIns=true)
Status QueryTransport(const URL &url, uint16_t query, AnyObject &result)
const uint16_t suPartial
const uint16_t errNotFound
const uint16_t stOK
Everything went OK.
DirListImpl< false > DirList
@ Stat
Stat each entry.
@ Merge
Merge duplicates.
@ Zip
List content of ZIP files.
@ Chunked
Serve chunked results for better performance.
static const uint16_t ServerFlags
returns server flags

References FileSystem(), XrdCl::DirectoryList::Add(), XrdCl::DirectoryList::At(), XrdCl::LocationInfo::At(), XrdCl::DirectoryList::Begin(), XrdCl::DirListFlags::Chunked, XrdCl::Status::code, XrdCl::OpenFlags::Compress, DirList(), XrdCl::DirectoryList::End(), XrdCl::errNotFound, XrdCl::errNotSupported, XrdCl::RequestSync::FailureCount(), XrdCl::AnyObject::Get(), XrdCl::LocationInfo::Location::GetAddress(), XrdCl::DirectoryList::ListEntry::GetName(), XrdCl::DirectoryList::GetParentName(), XrdCl::DefaultEnv::GetPostMaster(), XrdCl::DirectoryList::GetSize(), XrdCl::LocationInfo::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(), Stat, XrdCl::DirListFlags::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
@ 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(), ClientDirlistRequest::dlen, 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(), Stat, XrdCl::DirListFlags::Stat, XrdCl::MessageSendParams::timeout, and XrdCl::DirListFlags::Zip.

Referenced by DirList(), DoLS(), and IndexRemote().

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 2186 of file XrdClFileSystem.cc.

2188 {
2189 if( pPlugIn )
2190 return pPlugIn->GetProperty( name, value );
2191
2192 if( name == "FollowRedirects" )
2193 {
2194 if( pImpl->fsdata->pFollowRedirects ) value = "true";
2195 else value = "false";
2196 return true;
2197 }
2198 else if( name == "LastURL" )
2199 {
2200 if( pImpl->fsdata->pLastUrl )
2201 {
2202 value = pImpl->fsdata->pLastUrl->GetURL();
2203 return true;
2204 }
2205 else return false;
2206 }
2207
2208 return false;
2209 }
Response NullRef< Response >::value

References XrdCl::NullRef< Response >::value.

Referenced by DoLS().

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 2063 of file XrdClFileSystem.cc.

2067 {
2068 if( pPlugIn )
2069 return XRootDStatus( stError, errNotSupported );
2070
2071 return XAttrOperationImpl( kXR_fattrGet, 0, path, attrs, handler, timeout );
2072 }
@ 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 2077 of file XrdClFileSystem.cc.

2081 {
2082 SyncResponseHandler handler;
2083 XRootDStatus st = GetXAttr( path, attrs, &handler, timeout );
2084 if( !st.IsOK() )
2085 return st;
2086
2087 std::vector<XAttr> *resp = 0;
2088 st = MessageUtils::WaitForResponse( &handler, resp );
2089 if( resp ) result.swap( *resp );
2090 delete resp;
2091
2092 return st;
2093 }
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 2133 of file XrdClFileSystem.cc.

2136 {
2137 if( pPlugIn )
2138 return XRootDStatus( stError, errNotSupported );
2139
2140 static const std::vector<std::string> nothing;
2141 return XAttrOperationImpl( kXR_fattrList, ClientFattrRequest::aData,
2142 path, nothing, handler, timeout );
2143 }
@ 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 2148 of file XrdClFileSystem.cc.

2151 {
2152 SyncResponseHandler handler;
2153 XRootDStatus st = ListXAttr( path, &handler, timeout );
2154 if( !st.IsOK() )
2155 return st;
2156
2157 std::vector<XAttr> *resp = 0;
2158 st = MessageUtils::WaitForResponse( &handler, resp );
2159 if( resp ) result.swap( *resp );
2160 delete resp;
2161
2162 return st;
2163 }
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(), 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_locate
Definition XProtocol.hh:139

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

Referenced by DirList(), and DoLocate().

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

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

Referenced by DoMkDir(), and XrdPosixXrootd::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 }
MkDirImpl< false > MkDir

References XrdCl::Status::IsOK(), 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

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

Referenced by DoMv(), 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 }
MvImpl< false > Mv

References XrdCl::Status::IsOK(), 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

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

Here is the call 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 }
PingImpl< false > Ping

References XrdCl::Status::IsOK(), 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 2011 of file XrdClFileSystem.cc.

2016 {
2017 SyncResponseHandler handler;
2018 Status st = Prepare( fileList, flags, priority, &handler, timeout );
2019 if( !st.IsOK() )
2020 return st;
2021
2022 return MessageUtils::WaitForResponse( &handler, response );
2023 }
PrepareImpl< false > Prepare

References XrdCl::Status::IsOK(), 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 1971 of file XrdClFileSystem.cc.

1976 {
1977 if( pPlugIn )
1978 return pPlugIn->Prepare( fileList, flags, priority, handler, timeout );
1979
1980 std::vector<std::string>::const_iterator it;
1981 std::string list;
1982 for( it = fileList.begin(); it != fileList.end(); ++it )
1983 {
1984 list += *it;
1985 list += "\n";
1986 }
1987 list.erase( list.length()-1, 1 );
1988
1989 Message *msg;
1990 ClientPrepareRequest *req;
1991 MessageUtils::CreateRequest( msg, req, list.length() );
1992
1993 req->requestid = kXR_prepare;
1994 req->options = 0xff & flags;
1995 req->optionX = 0xffff & ( flags >> 8 );
1996 req->prty = priority;
1997 req->dlen = list.length();
1998
1999 msg->Append( list.c_str(), list.length(), 24 );
2000
2001 MessageSendParams params; params.timeout = timeout;
2004
2005 return FileSystemData::Send( pImpl->fsdata, msg, handler, params );
2006 }
@ kXR_prepare
Definition XProtocol.hh:133

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

Referenced by DoPrepare().

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 }
ProtocolImpl< false > Protocol

References XrdCl::Status::IsOK(), 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

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

Here is the call 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 }
QueryImpl< false > Query

References XrdCl::Status::IsOK(), 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_query
Definition XProtocol.hh:113

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

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

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:699
kXR_unt16 requestid
Definition XProtocol.hh:697

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

Referenced by 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 }
RmImpl< false > Rm

References XrdCl::Status::IsOK(), 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:708

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

Referenced by DoRmDir(), and XrdPosixXrootd::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 }
RmDirImpl< false > RmDir

References XrdCl::Status::IsOK(), 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 1904 of file XrdClFileSystem.cc.

1907 {
1908 SyncResponseHandler handler;
1909 Status st = SendCache( info, &handler, timeout );
1910 if( !st.IsOK() )
1911 return st;
1912
1913 return MessageUtils::WaitForResponse( &handler, response );
1914 }
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 1890 of file XrdClFileSystem.cc.

1893 {
1894 // Note: adding SendCache() to the FileSystemPlugin class breaks ABI!
1895 // So, the class is missing this until we do a major release. TODO
1896 //if( pPlugIn )
1897 // return pPlugIn->SendCache( info, handler, timeout );
1898 return SendSet("cache ", info, handler, timeout );
1899 }

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 1931 of file XrdClFileSystem.cc.

1934 {
1935 SyncResponseHandler handler;
1936 Status st = SendInfo( info, &handler, timeout );
1937 if( !st.IsOK() )
1938 return st;
1939
1940 return MessageUtils::WaitForResponse( &handler, response );
1941 }
SendInfoImpl< false > SendInfo

References XrdCl::Status::IsOK(), 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 1919 of file XrdClFileSystem.cc.

1922 {
1923 if( pPlugIn )
1924 return pPlugIn->SendInfo( info, handler, timeout );
1925 return SendSet("monitor info ", info, handler, timeout );
1926 }

◆ 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 2168 of file XrdClFileSystem.cc.

2170 {
2171 if( pPlugIn )
2172 return pPlugIn->SetProperty( name, value );
2173
2174 if( name == "FollowRedirects" )
2175 {
2176 if( value == "true" ) pImpl->fsdata->pFollowRedirects = true;
2177 else pImpl->fsdata->pFollowRedirects = false;
2178 return true;
2179 }
2180 return false;
2181 }

References XrdCl::NullRef< Response >::value.

◆ 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 2028 of file XrdClFileSystem.cc.

2032 {
2033 if( pPlugIn )
2034 return XRootDStatus( stError, errNotSupported );
2035
2036 return XAttrOperationImpl( kXR_fattrSet, 0, path, attrs, handler, timeout );
2037 }
@ 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 2042 of file XrdClFileSystem.cc.

2046 {
2047 SyncResponseHandler handler;
2048 XRootDStatus st = SetXAttr( path, attrs, &handler, timeout );
2049 if( !st.IsOK() )
2050 return st;
2051
2052 std::vector<XAttrStatus> *resp = 0;
2053 st = MessageUtils::WaitForResponse( &handler, resp );
2054 if( resp ) result.swap( *resp );
2055 delete resp;
2056
2057 return st;
2058 }
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:768

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

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

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:763

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

Referenced by DoStatVFS(), and XrdPosixXrootd::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 }
StatVFSImpl< false > StatVFS

References XrdCl::Status::IsOK(), 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

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

Referenced by DoTruncate(), Truncate(), and XrdPosixXrootd::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:

◆ AssignLBHandler

friend class AssignLBHandler
friend

Definition at line 204 of file XrdClFileSystem.hh.

References AssignLBHandler.

Referenced by AssignLBHandler.

◆ ForkHandler

friend class ForkHandler
friend

Definition at line 205 of file XrdClFileSystem.hh.

References ForkHandler.

Referenced by ForkHandler.


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