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

1090 :
1091 pImpl( new FileSystemImpl( url ) ),
1092 pPlugIn(0)
1093 {
1094 //--------------------------------------------------------------------------
1095 // Check if we need to install a plug-in for this URL
1096 //--------------------------------------------------------------------------
1097 if( enablePlugIns )
1098 {
1099 Log *log = DefaultEnv::GetLog();
1100 std::string urlStr = url.GetURL();
1101 PlugInFactory *fact = DefaultEnv::GetPlugInManager()->GetFactory(urlStr);
1102 if( fact )
1103 {
1104 pPlugIn = fact->CreateFileSystem( urlStr );
1105 if( !pPlugIn )
1106 {
1107 log->Error( FileMsg, "Plug-in factory failed to produce a plug-in "
1108 "for %s, continuing without one", url.GetObfuscatedURL().c_str() );
1109 }
1110 }
1111 }
1112
1113 if( !pPlugIn )
1115 }
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:113

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

1121 {
1122 if( !pPlugIn )
1123 {
1126 }
1127
1128 delete pPlugIn;
1129 delete pImpl;
1130 }
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 1469 of file XrdClFileSystem.cc.

1473 {
1474 if( pPlugIn )
1475 return pPlugIn->ChMod( path, mode, handler, timeout );
1476
1477 std::string fPath = FilterXrdClCgi( path );
1478
1479 Message *msg;
1480 ClientChmodRequest *req;
1481 MessageUtils::CreateRequest( msg, req, fPath.length() );
1482
1483 req->requestid = kXR_chmod;
1484 req->mode = mode;
1485 req->dlen = fPath.length();
1486 msg->Append( fPath.c_str(), fPath.length(), 24 );
1487 MessageSendParams params; params.timeout = timeout;
1490
1491 return FileSystemData::Send( pImpl->fsdata, msg, handler, params );
1492 }
@ 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 1497 of file XrdClFileSystem.cc.

1500 {
1501 SyncResponseHandler handler;
1502 Status st = ChMod( path, mode, &handler, timeout );
1503 if( !st.IsOK() )
1504 return st;
1505
1506 return MessageUtils::WaitForStatus( &handler );
1507 }
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 1192 of file XrdClFileSystem.cc.

1196 {
1197 SyncResponseHandler handler;
1198 Status st = DeepLocate( path, flags, &handler, timeout );
1199 if( !st.IsOK() )
1200 return st;
1201
1202 return MessageUtils::WaitForResponse( &handler, response );
1203 }
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 1180 of file XrdClFileSystem.cc.

1184 {
1185 return Locate( path, flags,
1186 new DeepLocateHandler( handler, path, flags, timeout ), timeout );
1187 }
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 2105 of file XrdClFileSystem.cc.

2109 {
2110 if( pPlugIn )
2111 return XRootDStatus( stError, errNotSupported );
2112
2113 return XAttrOperationImpl( kXR_fattrDel, 0, path, attrs, handler, timeout );
2114 }
@ 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 2119 of file XrdClFileSystem.cc.

2123 {
2124 SyncResponseHandler handler;
2125 XRootDStatus st = DelXAttr( path, attrs, &handler, timeout );
2126 if( !st.IsOK() )
2127 return st;
2128
2129 std::vector<XAttrStatus> *resp = 0;
2130 st = MessageUtils::WaitForResponse( &handler, resp );
2131 if( resp ) result.swap( *resp );
2132 delete resp;
2133
2134 return st;
2135 }
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 1723 of file XrdClFileSystem.cc.

1727 {
1728 //--------------------------------------------------------------------------
1729 // Chunked response is only possible for async DirList call
1730 //--------------------------------------------------------------------------
1731 if( flags & DirListFlags::Chunked )
1732 return XRootDStatus( stError, errNotSupported );
1733
1734 //--------------------------------------------------------------------------
1735 // If the path ends with '.zip' extension add Zip flag
1736 //--------------------------------------------------------------------------
1737 static const std::string zip_sufix = ".zip";
1738 if( path.size() >= zip_sufix.size() &&
1739 std::equal( zip_sufix.rbegin(), zip_sufix.rend(), path.rbegin() ) )
1740 flags |= DirListFlags::Zip;
1741
1742 //--------------------------------------------------------------------------
1743 // We do the deep locate and ask all the returned servers for the list
1744 //--------------------------------------------------------------------------
1745 if( flags & DirListFlags::Locate )
1746 {
1747 bool isserver = false;
1748 //------------------------------------------------------------------------
1749 // Check if destination is a data server
1750 //------------------------------------------------------------------------
1751 {
1752 AnyObject obj;
1753 XRootDStatus st = DefaultEnv::GetPostMaster()->QueryTransport(
1754 *pImpl->fsdata->pUrl, XRootDQuery::ServerFlags, obj);
1755
1756 if( st.IsOK() )
1757 {
1758 int *ptr = 0;
1759 obj.Get( ptr );
1760 isserver = ( ptr && (*ptr & kXR_isServer) );
1761 delete ptr;
1762 }
1763 }
1764
1765 if (isserver) {
1766 // Just disable the locate flag if we are talking to a single server
1767 flags &= ~DirListFlags::Locate;
1768 } else {
1769 //------------------------------------------------------------------------
1770 // Locate all the disk servers holding the directory
1771 //------------------------------------------------------------------------
1772 LocationInfo *locations;
1773 std::string locatePath = "*"; locatePath += path;
1774
1775 XRootDStatus st = DeepLocate(locatePath,
1779 locations);
1780
1781 if( !st.IsOK() )
1782 return st;
1783
1784 if( locations->GetSize() == 0 )
1785 {
1786 delete locations;
1787 return XRootDStatus( stError, errNotFound );
1788 }
1789
1790 //------------------------------------------------------------------------
1791 // Ask each server for a directory list
1792 //------------------------------------------------------------------------
1793 flags &= ~DirListFlags::Locate;
1794 FileSystem *fs;
1795 DirectoryList *currentResp = 0;
1796 uint32_t errors = 0;
1797 uint32_t numLocations = locations->GetSize();
1798 bool partial = st.code == suPartial ? true : false;
1799
1800 response = new DirectoryList();
1801 response->SetParentName( path );
1802
1803 for( uint32_t i = 0; i < locations->GetSize(); ++i )
1804 {
1805 URL locationURL( locations->At(i).GetAddress() );
1806 // make sure the original protocol is preserved (root vs roots)
1807 locationURL.SetProtocol( pImpl->fsdata->pUrl->GetProtocol() );
1808 fs = new FileSystem( locationURL );
1809 st = fs->DirList( path, flags, currentResp, timeout );
1810 if( !st.IsOK() )
1811 {
1812 ++errors;
1813 delete fs;
1814 continue;
1815 }
1816
1817 if( st.code == suPartial )
1818 partial = true;
1819
1821
1822 for( it = currentResp->Begin(); it != currentResp->End(); ++it )
1823 {
1824 response->Add( *it );
1825 *it = 0;
1826 }
1827
1828 delete fs;
1829 delete currentResp;
1830 fs = 0;
1831 currentResp = 0;
1832 }
1833
1834 delete locations;
1835
1836 if( flags & DirListFlags::Merge )
1837 MergeDirListHandler::Merge( response );
1838
1839 if( errors || partial )
1840 {
1841 if( errors == numLocations )
1842 return st;
1843 return XRootDStatus( stOK, suPartial );
1844 }
1845 return XRootDStatus();
1846 }
1847 }
1848
1849 //--------------------------------------------------------------------------
1850 // We just ask the current server
1851 //--------------------------------------------------------------------------
1852 SyncResponseHandler handler;
1853 XRootDStatus st = DirList( path, flags, &handler, timeout );
1854 if( !st.IsOK() )
1855 return st;
1856
1857 st = MessageUtils::WaitForResponse( &handler, response );
1858 if( !st.IsOK() )
1859 return st;
1860
1861 //--------------------------------------------------------------------------
1862 // Do the stats on all the entries if necessary.
1863 // If we already have the stat objects it means that the bulk stat has
1864 // succeeded.
1865 //--------------------------------------------------------------------------
1866 if( !(flags & DirListFlags::Stat) )
1867 return st;
1868
1869 if( response->GetSize() && response->At(0)->GetStatInfo() )
1870 return st;
1871
1872 uint32_t quota = response->GetSize() <= 1024 ? response->GetSize() : 1024;
1873 RequestSync sync( response->GetSize(), quota );
1874 for( uint32_t i = 0; i < response->GetSize(); ++i )
1875 {
1876 std::string fullPath = response->GetParentName()+response->At(i)->GetName();
1877 ResponseHandler *handler = new DirListStatHandler( response, i, &sync );
1878 st = Stat( fullPath, handler, timeout );
1879 if( !st.IsOK() )
1880 {
1881 sync.TaskDone( false );
1882 delete handler;
1883 }
1884 sync.WaitForQuota();
1885 }
1886 sync.WaitForAll();
1887
1888 if( sync.FailureCount() )
1889 return XRootDStatus( stOK, suPartial );
1890
1891 return XRootDStatus();
1892 }
#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 1669 of file XrdClFileSystem.cc.

1673 {
1674 if( pPlugIn )
1675 return pPlugIn->DirList( path, flags, handler, timeout );
1676
1677 URL url = URL( path );
1678 std::string fPath = FilterXrdClCgi( path );
1679
1680 if( flags & DirListFlags::Zip )
1681 {
1682 // stat the file to check if it is a directory or a file
1683 // the ZIP handler will take care of the rest
1684 ZipListHandler *zipHandler = new ZipListHandler( *pImpl->fsdata->pUrl, path, flags, handler, timeout );
1685 XRootDStatus st = Stat( path, zipHandler, timeout );
1686 if( !st.IsOK() )
1687 delete zipHandler;
1688 return st;
1689 }
1690
1691 Message *msg;
1692 ClientDirlistRequest *req;
1693 MessageUtils::CreateRequest( msg, req, fPath.length() );
1694
1695 req->requestid = kXR_dirlist;
1696 req->dlen = fPath.length();
1697
1698 if( ( flags & DirListFlags::Stat ) || ( flags & DirListFlags::Recursive ) )
1699 req->options[0] = kXR_dstat;
1700
1701 if( ( flags & DirListFlags::Cksm ) )
1702 req->options[0] = kXR_dstat | kXR_dcksm;
1703
1704 if( flags & DirListFlags::Recursive )
1705 handler = new RecursiveDirListHandler( *pImpl->fsdata->pUrl, url.GetPath(), flags, handler, timeout );
1706
1707 if( flags & DirListFlags::Merge )
1708 handler = new MergeDirListHandler( flags & DirListFlags::Chunked, handler );
1709
1710 msg->Append( fPath.c_str(), fPath.length(), 24 );
1711 MessageSendParams params; params.timeout = timeout;
1712 if( flags & DirListFlags::Chunked )
1713 params.chunkedResponse = true;
1716
1717 return FileSystemData::Send( pImpl->fsdata, msg, handler, params );
1718 }
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 2193 of file XrdClFileSystem.cc.

2195 {
2196 if( pPlugIn )
2197 return pPlugIn->GetProperty( name, value );
2198
2199 if( name == "FollowRedirects" )
2200 {
2201 if( pImpl->fsdata->pFollowRedirects ) value = "true";
2202 else value = "false";
2203 return true;
2204 }
2205 else if( name == "LastURL" )
2206 {
2207 if( pImpl->fsdata->pLastUrl )
2208 {
2209 value = pImpl->fsdata->pLastUrl->GetURL();
2210 return true;
2211 }
2212 else return false;
2213 }
2214
2215 return false;
2216 }
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 2070 of file XrdClFileSystem.cc.

2074 {
2075 if( pPlugIn )
2076 return XRootDStatus( stError, errNotSupported );
2077
2078 return XAttrOperationImpl( kXR_fattrGet, 0, path, attrs, handler, timeout );
2079 }
@ 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 2084 of file XrdClFileSystem.cc.

2088 {
2089 SyncResponseHandler handler;
2090 XRootDStatus st = GetXAttr( path, attrs, &handler, timeout );
2091 if( !st.IsOK() )
2092 return st;
2093
2094 std::vector<XAttr> *resp = 0;
2095 st = MessageUtils::WaitForResponse( &handler, resp );
2096 if( resp ) result.swap( *resp );
2097 delete resp;
2098
2099 return st;
2100 }
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 2140 of file XrdClFileSystem.cc.

2143 {
2144 if( pPlugIn )
2145 return XRootDStatus( stError, errNotSupported );
2146
2147 static const std::vector<std::string> nothing;
2148 return XAttrOperationImpl( kXR_fattrList, ClientFattrRequest::aData,
2149 path, nothing, handler, timeout );
2150 }
@ 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 2155 of file XrdClFileSystem.cc.

2158 {
2159 SyncResponseHandler handler;
2160 XRootDStatus st = ListXAttr( path, &handler, timeout );
2161 if( !st.IsOK() )
2162 return st;
2163
2164 std::vector<XAttr> *resp = 0;
2165 st = MessageUtils::WaitForResponse( &handler, resp );
2166 if( resp ) result.swap( *resp );
2167 delete resp;
2168
2169 return st;
2170 }
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 1164 of file XrdClFileSystem.cc.

1168 {
1169 SyncResponseHandler handler;
1170 Status st = Locate( path, flags, &handler, timeout );
1171 if( !st.IsOK() )
1172 return st;
1173
1174 return MessageUtils::WaitForResponse( &handler, response );
1175 }

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

1139 {
1140 if( pPlugIn )
1141 return pPlugIn->Locate( path, flags, handler, timeout );
1142
1143 std::string fPath = FilterXrdClCgi( path );
1144
1145 Message *msg;
1146 ClientLocateRequest *req;
1147 MessageUtils::CreateRequest( msg, req, fPath.length() );
1148
1149 req->requestid = kXR_locate;
1150 req->options = flags;
1151 req->dlen = fPath.length();
1152 msg->Append( fPath.c_str(), fPath.length(), 24 );
1153 MessageSendParams params; params.timeout = timeout;
1155
1157
1158 return FileSystemData::Send( pImpl->fsdata, msg, handler, params );
1159 }
@ 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 1383 of file XrdClFileSystem.cc.

1388 {
1389 if( pPlugIn )
1390 return pPlugIn->MkDir( path, flags, mode, handler, timeout );
1391
1392 std::string fPath = FilterXrdClCgi( path );
1393
1394 Message *msg;
1395 ClientMkdirRequest *req;
1396 MessageUtils::CreateRequest( msg, req, fPath.length() );
1397
1398 req->requestid = kXR_mkdir;
1399 req->options[0] = flags;
1400 req->mode = mode;
1401 req->dlen = fPath.length();
1402 msg->Append( fPath.c_str(), fPath.length(), 24 );
1403 MessageSendParams params; params.timeout = timeout;
1406
1407 return FileSystemData::Send( pImpl->fsdata, msg, handler, params );
1408 }
@ 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 1413 of file XrdClFileSystem.cc.

1417 {
1418 SyncResponseHandler handler;
1419 Status st = MkDir( path, flags, mode, &handler, timeout );
1420 if( !st.IsOK() )
1421 return st;
1422
1423 return MessageUtils::WaitForStatus( &handler );
1424 }
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 1208 of file XrdClFileSystem.cc.

1212 {
1213 if( pPlugIn )
1214 return pPlugIn->Mv( source, dest, handler, timeout );
1215
1216 std::string fSource = FilterXrdClCgi( source );
1217 std::string fDest = FilterXrdClCgi( dest );
1218
1219 Message *msg;
1220 ClientMvRequest *req;
1221 MessageUtils::CreateRequest( msg, req, fSource.length() + fDest.length()+1 );
1222
1223 req->requestid = kXR_mv;
1224 req->dlen = fSource.length() + fDest.length()+1;
1225 req->arg1len = fSource.length();
1226 msg->Append( fSource.c_str(), fSource.length(), 24 );
1227 *msg->GetBuffer(24 + fSource.length()) = ' ';
1228 msg->Append( fDest.c_str(), fDest.length(), 25 + fSource.length() );
1229 MessageSendParams params; params.timeout = timeout;
1231
1233
1234 return FileSystemData::Send( pImpl->fsdata, msg, handler, params );
1235 }
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 1240 of file XrdClFileSystem.cc.

1243 {
1244 SyncResponseHandler handler;
1245 Status st = Mv( source, dest, &handler, timeout );
1246 if( !st.IsOK() )
1247 return st;
1248
1249 return MessageUtils::WaitForStatus( &handler );
1250 }
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 1512 of file XrdClFileSystem.cc.

1514 {
1515 if( pPlugIn )
1516 return pPlugIn->Ping( handler, timeout );
1517
1518 Message *msg;
1519 ClientPingRequest *req;
1520 MessageUtils::CreateRequest( msg, req );
1521
1522 req->requestid = kXR_ping;
1523 MessageSendParams params; params.timeout = timeout;
1526
1527 return FileSystemData::Send( pImpl->fsdata, msg, handler, params );
1528 }
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 1533 of file XrdClFileSystem.cc.

1534 {
1535 SyncResponseHandler handler;
1536 Status st = Ping( &handler, timeout );
1537 if( !st.IsOK() )
1538 return st;
1539
1540 return MessageUtils::WaitForStatus( &handler );
1541 }
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 2018 of file XrdClFileSystem.cc.

2023 {
2024 SyncResponseHandler handler;
2025 Status st = Prepare( fileList, flags, priority, &handler, timeout );
2026 if( !st.IsOK() )
2027 return st;
2028
2029 return MessageUtils::WaitForResponse( &handler, response );
2030 }
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 1978 of file XrdClFileSystem.cc.

1983 {
1984 if( pPlugIn )
1985 return pPlugIn->Prepare( fileList, flags, priority, handler, timeout );
1986
1987 std::vector<std::string>::const_iterator it;
1988 std::string list;
1989 for( it = fileList.begin(); it != fileList.end(); ++it )
1990 {
1991 list += *it;
1992 list += "\n";
1993 }
1994 list.erase( list.length()-1, 1 );
1995
1996 Message *msg;
1997 ClientPrepareRequest *req;
1998 MessageUtils::CreateRequest( msg, req, list.length() );
1999
2000 req->requestid = kXR_prepare;
2001 req->options = 0xff & flags;
2002 req->optionX = 0xffff & ( flags >> 8 );
2003 req->prty = priority;
2004 req->dlen = list.length();
2005
2006 msg->Append( list.c_str(), list.length(), 24 );
2007
2008 MessageSendParams params; params.timeout = timeout;
2011
2012 return FileSystemData::Send( pImpl->fsdata, msg, handler, params );
2013 }
@ 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 1655 of file XrdClFileSystem.cc.

1657 {
1658 SyncResponseHandler handler;
1659 Status st = Protocol( &handler, timeout );
1660 if( !st.IsOK() )
1661 return st;
1662
1663 return MessageUtils::WaitForResponse( &handler, response );
1664 }
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 1633 of file XrdClFileSystem.cc.

1635 {
1636 if( pPlugIn )
1637 return pPlugIn->Protocol( handler, timeout );
1638
1639 Message *msg;
1640 ClientProtocolRequest *req;
1641 MessageUtils::CreateRequest( msg, req );
1642
1643 req->requestid = kXR_protocol;
1645 MessageSendParams params; params.timeout = timeout;
1648
1649 return FileSystemData::Send( pImpl->fsdata, msg, handler, params );
1650 }
@ 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 1281 of file XrdClFileSystem.cc.

1285 {
1286 SyncResponseHandler handler;
1287 Status st = Query( queryCode, arg, &handler, timeout );
1288 if( !st.IsOK() )
1289 return st;
1290
1291 return MessageUtils::WaitForResponse( &handler, response );
1292 }
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 1255 of file XrdClFileSystem.cc.

1259 {
1260 if( pPlugIn )
1261 return pPlugIn->Query( queryCode, arg, handler, timeout );
1262
1263 Message *msg;
1264 ClientQueryRequest *req;
1265 MessageUtils::CreateRequest( msg, req, arg.GetSize() );
1266
1267 req->requestid = kXR_query;
1268 req->infotype = queryCode;
1269 req->dlen = arg.GetSize();
1270 msg->Append( arg.GetBuffer(), arg.GetSize(), 24 );
1271 MessageSendParams params; params.timeout = timeout;
1274
1275 return FileSystemData::Send( pImpl->fsdata, msg, handler, params );
1276 }
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 1340 of file XrdClFileSystem.cc.

1343 {
1344 if( pPlugIn )
1345 return pPlugIn->Rm( path, handler, timeout );
1346
1347 if( pImpl->fsdata->pUrl->IsLocalFile() )
1348 return LocalFS::Instance().Rm( path, handler, timeout );
1349
1350 std::string fPath = FilterXrdClCgi( path );
1351
1352 Message *msg;
1353 ClientRmRequest *req;
1354 MessageUtils::CreateRequest( msg, req, fPath.length() );
1355
1356 req->requestid = kXR_rm;
1357 req->dlen = fPath.length();
1358 msg->Append( fPath.c_str(), fPath.length(), 24 );
1359 MessageSendParams params; params.timeout = timeout;
1362
1363 return FileSystemData::Send( pImpl->fsdata, msg, handler, params );
1364 }
@ 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 1369 of file XrdClFileSystem.cc.

1371 {
1372 SyncResponseHandler handler;
1373 Status st = Rm( path, &handler, timeout );
1374 if( !st.IsOK() )
1375 return st;
1376
1377 return MessageUtils::WaitForStatus( &handler );
1378 }
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 1429 of file XrdClFileSystem.cc.

1432 {
1433 if( pPlugIn )
1434 return pPlugIn->RmDir( path, handler, timeout );
1435
1436 std::string fPath = FilterXrdClCgi( path );
1437
1438 Message *msg;
1439 ClientRmdirRequest *req;
1440 MessageUtils::CreateRequest( msg, req, fPath.length() );
1441
1442 req->requestid = kXR_rmdir;
1443 req->dlen = fPath.length();
1444 msg->Append( fPath.c_str(), fPath.length(), 24 );
1445 MessageSendParams params; params.timeout = timeout;
1448
1449 return FileSystemData::Send( pImpl->fsdata, msg, handler, params );
1450 }
@ 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 1455 of file XrdClFileSystem.cc.

1457 {
1458 SyncResponseHandler handler;
1459 Status st = RmDir( path, &handler, timeout );
1460 if( !st.IsOK() )
1461 return st;
1462
1463 return MessageUtils::WaitForStatus( &handler );
1464 }
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 1911 of file XrdClFileSystem.cc.

1914 {
1915 SyncResponseHandler handler;
1916 Status st = SendCache( info, &handler, timeout );
1917 if( !st.IsOK() )
1918 return st;
1919
1920 return MessageUtils::WaitForResponse( &handler, response );
1921 }
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 1897 of file XrdClFileSystem.cc.

1900 {
1901 // Note: adding SendCache() to the FileSystemPlugin class breaks ABI!
1902 // So, the class is missing this until we do a major release. TODO
1903 //if( pPlugIn )
1904 // return pPlugIn->SendCache( info, handler, timeout );
1905 return SendSet("cache ", info, handler, timeout );
1906 }

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

1941 {
1942 SyncResponseHandler handler;
1943 Status st = SendInfo( info, &handler, timeout );
1944 if( !st.IsOK() )
1945 return st;
1946
1947 return MessageUtils::WaitForResponse( &handler, response );
1948 }
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 1926 of file XrdClFileSystem.cc.

1929 {
1930 if( pPlugIn )
1931 return pPlugIn->SendInfo( info, handler, timeout );
1932 return SendSet("monitor info ", info, handler, timeout );
1933 }

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

2177 {
2178 if( pPlugIn )
2179 return pPlugIn->SetProperty( name, value );
2180
2181 if( name == "FollowRedirects" )
2182 {
2183 if( value == "true" ) pImpl->fsdata->pFollowRedirects = true;
2184 else pImpl->fsdata->pFollowRedirects = false;
2185 return true;
2186 }
2187 return false;
2188 }

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

2039 {
2040 if( pPlugIn )
2041 return XRootDStatus( stError, errNotSupported );
2042
2043 return XAttrOperationImpl( kXR_fattrSet, 0, path, attrs, handler, timeout );
2044 }
@ 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 2049 of file XrdClFileSystem.cc.

2053 {
2054 SyncResponseHandler handler;
2055 XRootDStatus st = SetXAttr( path, attrs, &handler, timeout );
2056 if( !st.IsOK() )
2057 return st;
2058
2059 std::vector<XAttrStatus> *resp = 0;
2060 st = MessageUtils::WaitForResponse( &handler, resp );
2061 if( resp ) result.swap( *resp );
2062 delete resp;
2063
2064 return st;
2065 }
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 1546 of file XrdClFileSystem.cc.

1549 {
1550 if( pPlugIn )
1551 return pPlugIn->Stat( path, handler, timeout );
1552
1553 if( pImpl->fsdata->pUrl->IsLocalFile() )
1554 return LocalFS::Instance().Stat( path, handler, timeout );
1555
1556 std::string fPath = FilterXrdClCgi( path );
1557
1558 Message *msg;
1559 ClientStatRequest *req;
1560 MessageUtils::CreateRequest( msg, req, fPath.length() );
1561
1562 req->requestid = kXR_stat;
1563 req->options = 0;
1564 req->dlen = fPath.length();
1565 msg->Append( fPath.c_str(), fPath.length(), 24 );
1566 MessageSendParams params; params.timeout = timeout;
1569
1570 return FileSystemData::Send( pImpl->fsdata, msg, handler, params );
1571 }
@ 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 1576 of file XrdClFileSystem.cc.

1579 {
1580 SyncResponseHandler handler;
1581 Status st = Stat( path, &handler, timeout );
1582 if( !st.IsOK() )
1583 return st;
1584
1585 return MessageUtils::WaitForResponse( &handler, response );
1586 }

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

1594 {
1595 if( pPlugIn )
1596 return pPlugIn->StatVFS( path, handler, timeout );
1597
1598 std::string fPath = FilterXrdClCgi( path );
1599
1600 Message *msg;
1601 ClientStatRequest *req;
1602 MessageUtils::CreateRequest( msg, req, fPath.length() );
1603
1604 req->requestid = kXR_stat;
1605 req->options = kXR_vfs;
1606 req->dlen = fPath.length();
1607 msg->Append( fPath.c_str(), fPath.length(), 24 );
1608 MessageSendParams params; params.timeout = timeout;
1611
1612 return FileSystemData::Send( pImpl->fsdata, msg, handler, params );
1613 }
@ 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 1618 of file XrdClFileSystem.cc.

1621 {
1622 SyncResponseHandler handler;
1623 Status st = StatVFS( path, &handler, timeout );
1624 if( !st.IsOK() )
1625 return st;
1626
1627 return MessageUtils::WaitForResponse( &handler, response );
1628 }
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 1297 of file XrdClFileSystem.cc.

1301 {
1302 if( pPlugIn )
1303 return pPlugIn->Truncate( path, size, handler, timeout );
1304
1305 std::string fPath = FilterXrdClCgi( path );
1306
1307 Message *msg;
1308 ClientTruncateRequest *req;
1309 MessageUtils::CreateRequest( msg, req, fPath.length() );
1310
1311 req->requestid = kXR_truncate;
1312 req->offset = size;
1313 req->dlen = fPath.length();
1314 msg->Append( fPath.c_str(), fPath.length(), 24 );
1315 MessageSendParams params; params.timeout = timeout;
1318
1319 return FileSystemData::Send( pImpl->fsdata, msg, handler, params );
1320 }
@ 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 1325 of file XrdClFileSystem.cc.

1328 {
1329 SyncResponseHandler handler;
1330 Status st = Truncate( path, size, &handler, timeout );
1331 if( !st.IsOK() )
1332 return st;
1333
1334 return MessageUtils::WaitForStatus( &handler );
1335 }
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: