|
xrootd
|
#include <XrdClFile.hh>

Public Member Functions | |
| File () | |
| Constructor. More... | |
| virtual | ~File () |
| Destructor. More... | |
| XRootDStatus | Open (const std::string &url, OpenFlags::Flags flags, Access::Mode mode, ResponseHandler *handler, uint16_t timeout=0) |
| XRootDStatus | Open (const std::string &url, OpenFlags::Flags flags, Access::Mode mode=Access::None, uint16_t timeout=0) |
| XRootDStatus | Close (ResponseHandler *handler, uint16_t timeout=0) |
| XRootDStatus | Close (uint16_t timeout=0) |
| XRootDStatus | Stat (bool force, ResponseHandler *handler, uint16_t timeout=0) |
| XRootDStatus | Stat (bool force, StatInfo *&response, uint16_t timeout=0) |
| XRootDStatus | Read (uint64_t offset, uint32_t size, void *buffer, ResponseHandler *handler, uint16_t timeout=0) |
| XRootDStatus | Read (uint64_t offset, uint32_t size, void *buffer, uint32_t &bytesRead, uint16_t timeout=0) |
| XRootDStatus | Write (uint64_t offset, uint32_t size, const void *buffer, ResponseHandler *handler, uint16_t timeout=0) |
| XRootDStatus | Write (uint64_t offset, uint32_t size, const void *buffer, uint16_t timeout=0) |
| XRootDStatus | Sync (ResponseHandler *handler, uint16_t timeout=0) |
| XRootDStatus | Sync (uint16_t timeout=0) |
| XRootDStatus | Truncate (uint64_t size, ResponseHandler *handler, uint16_t timeout=0) |
| XRootDStatus | Truncate (uint64_t size, uint16_t timeout=0) |
| XRootDStatus | VectorRead (const ChunkList &chunks, void *buffer, ResponseHandler *handler, uint16_t timeout=0) |
| XRootDStatus | VectorRead (const ChunkList &chunks, void *buffer, VectorReadInfo *&vReadInfo, uint16_t timeout=0) |
| bool | IsOpen () const |
| Check if the file is open. More... | |
| void | EnableReadRecovery (bool enable=true) |
| void | EnableWriteRecovery (bool enable=true) |
| std::string | GetDataServer () const |
| Get the data server the file is accessed at. More... | |
| URL | GetLastURL () const |
| Get final url with all the cgi information. More... | |
Private Attributes | |
| FileStateHandler * | pStateHandler |
A file.
| XrdCl::File::File | ( | ) |
Constructor.
References pStateHandler.
|
virtual |
Destructor.
References Close(), and pStateHandler.
| XRootDStatus XrdCl::File::Close | ( | ResponseHandler * | handler, |
| uint16_t | timeout = 0 |
||
| ) |
Close the file - async
| handler | handler to be notified about the status of the operation |
| timeout | timeout value, if 0 the environment default will be used |
References XrdCl::FileStateHandler::Close(), and pStateHandler.
Referenced by XrdCl::ThirdPartyCopyJob::CanDo(), Close(), XrdCl::ThirdPartyCopyJob::Run(), and ~File().
| XRootDStatus XrdCl::File::Close | ( | uint16_t | timeout = 0 | ) |
Close the file - sync
| timeout | timeout value, if 0 the environment default will be used |
References Close(), XrdCl::Status::IsOK(), and XrdCl::MessageUtils::WaitForStatus().
| void XrdCl::File::EnableReadRecovery | ( | bool | enable = true | ) |
Enable/disable state recovery procedures while the file is open for reading
References XrdCl::FileStateHandler::EnableReadRecovery(), and pStateHandler.
| void XrdCl::File::EnableWriteRecovery | ( | bool | enable = true | ) |
Enable/disable state recovery procedures while the file is open for writing or read/write
References XrdCl::FileStateHandler::EnableWriteRecovery(), and pStateHandler.
| std::string XrdCl::File::GetDataServer | ( | ) | const |
Get the data server the file is accessed at.
References XrdCl::FileStateHandler::GetDataServer(), and pStateHandler.
| URL XrdCl::File::GetLastURL | ( | ) | const |
Get final url with all the cgi information.
References XrdCl::FileStateHandler::GetLastURL(), and pStateHandler.
Referenced by XrdCl::ThirdPartyCopyJob::CanDo(), and XrdCl::ThirdPartyCopyJob::Run().
| bool XrdCl::File::IsOpen | ( | ) | const |
Check if the file is open.
References XrdCl::FileStateHandler::IsOpen(), and pStateHandler.
| XRootDStatus XrdCl::File::Open | ( | const std::string & | url, |
| OpenFlags::Flags | flags, | ||
| Access::Mode | mode, | ||
| ResponseHandler * | handler, | ||
| uint16_t | timeout = 0 |
||
| ) |
Open the file pointed to by the given URL - async
| url | url of the file to be opened |
| flags | OpenFlags::Flags |
| mode | Access::Mode for new files, 0 otherwise |
| handler | handler to be notified about the status of the operation |
| timeout | timeout value, if 0 the environment default will be used |
References XrdCl::FileStateHandler::Open(), and pStateHandler.
Referenced by XrdCl::ThirdPartyCopyJob::CanDo(), Open(), ThreadingTest::ReadTestFunc(), and XrdCl::ThirdPartyCopyJob::Run().
| XRootDStatus XrdCl::File::Open | ( | const std::string & | url, |
| OpenFlags::Flags | flags, | ||
| Access::Mode | mode = Access::None, |
||
| uint16_t | timeout = 0 |
||
| ) |
Open the file pointed to by the given URL - sync
| url | url of the file to be opened |
| flags | OpenFlags::Flags |
| mode | Access::Mode for new files, 0 otherwise |
| timeout | timeout value, if 0 the environment default will be used |
References XrdCl::Status::IsOK(), Open(), and XrdCl::MessageUtils::WaitForStatus().
| XRootDStatus XrdCl::File::Read | ( | uint64_t | offset, |
| uint32_t | size, | ||
| void * | buffer, | ||
| ResponseHandler * | handler, | ||
| uint16_t | timeout = 0 |
||
| ) |
Read a data chunk at a given offset - async
| offset | offset from the beginning of the file |
| size | number of bytes to be read |
| buffer | a pointer to a buffer big enough to hold the data or 0 if the buffer should be allocated by the system |
| handler | handler to be notified when the response arrives, the response parameter will hold a ChunkInfo object if the procedure was successful |
| timeout | timeout value, if 0 the environment default will be used |
References pStateHandler, and XrdCl::FileStateHandler::Read().
Referenced by Read(), and ThreadingTest::ReadTestFunc().
| XRootDStatus XrdCl::File::Read | ( | uint64_t | offset, |
| uint32_t | size, | ||
| void * | buffer, | ||
| uint32_t & | bytesRead, | ||
| uint16_t | timeout = 0 |
||
| ) |
Read a data chunk at a given offset - sync
| offset | offset from the beginning of the file |
| size | number of bytes to be read |
| buffer | a pointer to a buffer big enough to hold the data |
| bytesRead | number of bytes actually read |
| timeout | timeout value, if 0 the environment default will be used |
References XrdCl::Status::IsOK(), XrdCl::ChunkInfo::length, Read(), and XrdCl::MessageUtils::WaitForResponse().
| XRootDStatus XrdCl::File::Stat | ( | bool | force, |
| ResponseHandler * | handler, | ||
| uint16_t | timeout = 0 |
||
| ) |
Obtain status information for this file - async
| force | do not use the cached information, force re-stating |
| handler | handler to be notified when the response arrives, the response parameter will hold a StatInfo object if the procedure is successful |
| timeout | timeout value, if 0 the environment default will be used |
References pStateHandler, and XrdCl::FileStateHandler::Stat().
Referenced by XrdCl::ThirdPartyCopyJob::CanDo(), ThreadingTest::ReadTestFunc(), and Stat().
| XRootDStatus XrdCl::File::Stat | ( | bool | force, |
| StatInfo *& | response, | ||
| uint16_t | timeout = 0 |
||
| ) |
Obtain status information for this file - sync
| force | do not use the cached information, force re-stating |
| response | the response (to be deleted by the user) |
| timeout | timeout value, if 0 the environment default will be used |
References XrdCl::Status::IsOK(), Stat(), and XrdCl::MessageUtils::WaitForResponse().
| XRootDStatus XrdCl::File::Sync | ( | ResponseHandler * | handler, |
| uint16_t | timeout = 0 |
||
| ) |
Commit all pending disk writes - async
| handler | handler to be notified when the response arrives |
| timeout | timeout value, if 0 the environment default will be used |
References pStateHandler, and XrdCl::FileStateHandler::Sync().
Referenced by XrdCl::ThirdPartyCopyJob::Run(), and Sync().
| XRootDStatus XrdCl::File::Sync | ( | uint16_t | timeout = 0 | ) |
Commit all pending disk writes - sync
| timeout | timeout value, if 0 the environment default will be used |
References XrdCl::Status::IsOK(), Sync(), and XrdCl::MessageUtils::WaitForStatus().
| XRootDStatus XrdCl::File::Truncate | ( | uint64_t | size, |
| ResponseHandler * | handler, | ||
| uint16_t | timeout = 0 |
||
| ) |
Truncate the file to a particular size - async
| size | desired size of the file |
| handler | handler to be notified when the response arrives |
| timeout | timeout value, if 0 the environment default will be used |
References pStateHandler, and XrdCl::FileStateHandler::Truncate().
Referenced by Truncate().
| XRootDStatus XrdCl::File::Truncate | ( | uint64_t | size, |
| uint16_t | timeout = 0 |
||
| ) |
Truncate the file to a particular size - sync
| size | desired size of the file |
| timeout | timeout value, if 0 the environment default will be used |
References XrdCl::Status::IsOK(), Truncate(), and XrdCl::MessageUtils::WaitForStatus().
| XRootDStatus XrdCl::File::VectorRead | ( | const ChunkList & | chunks, |
| void * | buffer, | ||
| ResponseHandler * | handler, | ||
| uint16_t | timeout = 0 |
||
| ) |
Read scattered data chunks in one operation - async
| chunks | list of the chunks to be read and buffers to put the data in. The default maximum chunk size is 2097136 bytes and the default maximum number of chunks per request is 1024. The server may be queried using FileSystem::Query for the actual settings. |
| buffer | if zero the buffer pointers in the chunk list will be used, otherwise it needs to point to a buffer big enough to hold the requested data |
| handler | handler to be notified when the response arrives |
| timeout | timeout value, if 0 then the environment default will be used |
References pStateHandler, and XrdCl::FileStateHandler::VectorRead().
Referenced by VectorRead().
| XRootDStatus XrdCl::File::VectorRead | ( | const ChunkList & | chunks, |
| void * | buffer, | ||
| VectorReadInfo *& | vReadInfo, | ||
| uint16_t | timeout = 0 |
||
| ) |
Read scattered data chunks in one operation - sync
| chunks | list of the chunks to be read and buffers to put the data in. The default maximum chunk size is 2097136 bytes and the default maximum number of chunks per request is 1024. The server may be queried using FileSystem::Query for the actual settings. |
| buffer | if zero the buffer pointers in the chunk list will be used, otherwise it needs to point to a buffer big enough to hold the requested data |
| vReadInfo | buffer size and chunk information |
| timeout | timeout value, if 0 then the environment default will be used |
References XrdCl::Status::IsOK(), VectorRead(), and XrdCl::MessageUtils::WaitForResponse().
| XRootDStatus XrdCl::File::Write | ( | uint64_t | offset, |
| uint32_t | size, | ||
| const void * | buffer, | ||
| ResponseHandler * | handler, | ||
| uint16_t | timeout = 0 |
||
| ) |
Write a data chunk at a given offset - async The call interprets and returns the server response, which may be either a success or a failure, it does not contain the number of bytes that were actually written.
| offset | offset from the beginning of the file |
| size | number of bytes to be written |
| buffer | a pointer to the buffer holding the data to be written |
| handler | handler to be notified when the response arrives |
| timeout | timeout value, if 0 the environment default will be used |
References pStateHandler, and XrdCl::FileStateHandler::Write().
Referenced by Write().
| XRootDStatus XrdCl::File::Write | ( | uint64_t | offset, |
| uint32_t | size, | ||
| const void * | buffer, | ||
| uint16_t | timeout = 0 |
||
| ) |
Write a data chunk at a given offset - sync The call interprets and returns the server response, which may be either a success or a failure, it does not contain the number of bytes that were actually written.
| offset | offset from the beginning of the file |
| size | number of bytes to be written |
| buffer | a pointer to the buffer holding the data to be written |
| timeout | timeout value, if 0 the environment default will be used |
References XrdCl::Status::IsOK(), XrdCl::MessageUtils::WaitForStatus(), and Write().
|
private |
Referenced by Close(), EnableReadRecovery(), EnableWriteRecovery(), File(), GetDataServer(), GetLastURL(), IsOpen(), Open(), Read(), Stat(), Sync(), Truncate(), VectorRead(), Write(), and ~File().
1.8.3.1