XrdCl::File Class Reference

A file. More...

#include <XrdClFile.hh>

List of all members.

Public Types

enum  VirtRedirect { EnableVirtRedirect, DisableVirtRedirect }

Public Member Functions

 File (bool enablePlugIns=true)
 Constructor.
 File (VirtRedirect virtRedirect, bool enablePlugIns=true)
 Constructor.
virtual ~File ()
 Destructor.
XRootDStatus Open (const std::string &url, OpenFlags::Flags flags, Access::Mode mode, ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
XRootDStatus Open (const std::string &url, OpenFlags::Flags flags, Access::Mode mode=Access::None, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
XRootDStatus Close (ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
XRootDStatus Close (uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
XRootDStatus Stat (bool force, ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
XRootDStatus Stat (bool force, StatInfo *&response, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
XRootDStatus Read (uint64_t offset, uint32_t size, void *buffer, ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
XRootDStatus Read (uint64_t offset, uint32_t size, void *buffer, uint32_t &bytesRead, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
XRootDStatus Write (uint64_t offset, uint32_t size, const void *buffer, ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
XRootDStatus Write (uint64_t offset, uint32_t size, const void *buffer, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
XRootDStatus Sync (ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
XRootDStatus Sync (uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
XRootDStatus Truncate (uint64_t size, ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
XRootDStatus Truncate (uint64_t size, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
XRootDStatus VectorRead (const ChunkList &chunks, void *buffer, ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
XRootDStatus VectorRead (const ChunkList &chunks, void *buffer, VectorReadInfo *&vReadInfo, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
XRootDStatus WriteV (uint64_t offset, const struct iovec *iov, int iovcnt, ResponseHandler *handler, uint16_t timeout=0)
XRootDStatus WriteV (uint64_t offset, const struct iovec *iov, int iovcnt, uint16_t timeout=0)
XRootDStatus Fcntl (const Buffer &arg, ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
XRootDStatus Fcntl (const Buffer &arg, Buffer *&response, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
XRootDStatus Visa (ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
XRootDStatus Visa (Buffer *&visa, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
bool IsOpen () const
 Check if the file is open.
bool SetProperty (const std::string &name, const std::string &value)
bool GetProperty (const std::string &name, std::string &value) const

Private Attributes

FileStateHandler * pStateHandler
FilePlugIn * pPlugIn
bool pEnablePlugIns

Detailed Description

A file.


Member Enumeration Documentation

Enumerator:
EnableVirtRedirect 
DisableVirtRedirect 

Constructor & Destructor Documentation

XrdCl::File::File ( bool  enablePlugIns = true  ) 

Constructor.

XrdCl::File::File ( VirtRedirect  virtRedirect,
bool  enablePlugIns = true 
)

Constructor.

virtual XrdCl::File::~File (  )  [virtual]

Destructor.


Member Function Documentation

XRootDStatus XrdCl::File::Close ( uint16_t  timeout = 0  ) 

Close the file - sync

Parameters:
timeout timeout value, if 0 the environment default will be used
Returns:
status of the operation
XRootDStatus XrdCl::File::Close ( ResponseHandler handler,
uint16_t  timeout = 0 
)

Close the file - async

Parameters:
handler handler to be notified about the status of the operation
timeout timeout value, if 0 the environment default will be used
Returns:
status of the operation
XRootDStatus XrdCl::File::Fcntl ( const Buffer arg,
Buffer *&  response,
uint16_t  timeout = 0 
)

Performs a custom operation on an open file, server implementation dependent - sync

Parameters:
arg query argument
response the response (to be deleted by the user)
timeout timeout value, if 0 the environment default will be used
Returns:
status of the operation
XRootDStatus XrdCl::File::Fcntl ( const Buffer arg,
ResponseHandler handler,
uint16_t  timeout = 0 
)

Performs a custom operation on an open file, server implementation dependent - async

Parameters:
arg query argument
handler handler to be notified when the response arrives, the response parameter will hold a Buffer object if the procedure is successful
timeout timeout value, if 0 the environment default will be used
Returns:
status of the operation
bool XrdCl::File::GetProperty ( const std::string &  name,
std::string &  value 
) const

Get file property

See also:
File::SetProperty for property list

Read-only properties: DataServer [string] - the data server the file is accessed at LastURL [string] - final file URL with all the cgi information

bool XrdCl::File::IsOpen (  )  const

Check if the file is open.

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

Parameters:
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
Returns:
status of the operation
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

Parameters:
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
Returns:
status of the operation
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

Parameters:
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
Returns:
status of the operation
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

Parameters:
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
Returns:
status of the operation
bool XrdCl::File::SetProperty ( const std::string &  name,
const std::string &  value 
)

Set file property

File properties: ReadRecovery [true/false] - enable/disable read recovery WriteRecovery [true/false] - enable/disable write recovery FollowRedirects [true/false] - enable/disable following redirections

XRootDStatus XrdCl::File::Stat ( bool  force,
StatInfo *&  response,
uint16_t  timeout = 0 
)

Obtain status information for this file - sync

Parameters:
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
Returns:
status of the operation
XRootDStatus XrdCl::File::Stat ( bool  force,
ResponseHandler handler,
uint16_t  timeout = 0 
)

Obtain status information for this file - async

Parameters:
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
Returns:
status of the operation
XRootDStatus XrdCl::File::Sync ( uint16_t  timeout = 0  ) 

Commit all pending disk writes - sync

Parameters:
timeout timeout value, if 0 the environment default will be used
Returns:
status of the operation
XRootDStatus XrdCl::File::Sync ( ResponseHandler handler,
uint16_t  timeout = 0 
)

Commit all pending disk writes - async

Parameters:
handler handler to be notified when the response arrives
timeout timeout value, if 0 the environment default will be used
Returns:
status of the operation
XRootDStatus XrdCl::File::Truncate ( uint64_t  size,
uint16_t  timeout = 0 
)

Truncate the file to a particular size - sync

Parameters:
size desired size of the file
timeout timeout value, if 0 the environment default will be used
Returns:
status of the operation
XRootDStatus XrdCl::File::Truncate ( uint64_t  size,
ResponseHandler handler,
uint16_t  timeout = 0 
)

Truncate the file to a particular size - async

Parameters:
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
Returns:
status of the operation
XRootDStatus XrdCl::File::VectorRead ( const ChunkList chunks,
void *  buffer,
VectorReadInfo *&  vReadInfo,
uint16_t  timeout = 0 
)

Read scattered data chunks in one operation - sync

Parameters:
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
Returns:
status of the operation
XRootDStatus XrdCl::File::VectorRead ( const ChunkList chunks,
void *  buffer,
ResponseHandler handler,
uint16_t  timeout = 0 
)

Read scattered data chunks in one operation - async

Parameters:
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
Returns:
status of the operation
XRootDStatus XrdCl::File::Visa ( Buffer *&  visa,
uint16_t  timeout = 0 
)

Get access token to a file - sync

Parameters:
visa the access token (to be deleted by the user)
timeout timeout value, if 0 the environment default will be used
Returns:
status of the operation
XRootDStatus XrdCl::File::Visa ( ResponseHandler handler,
uint16_t  timeout = 0 
)

Get access token to a file - async

Parameters:
handler handler to be notified when the response arrives, the response parameter will hold a Buffer object if the procedure is successful
timeout timeout value, if 0 the environment default will be used
Returns:
status of the operation
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.

Parameters:
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
Returns:
status of the operation
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.

Parameters:
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
Returns:
status of the operation
XRootDStatus XrdCl::File::WriteV ( uint64_t  offset,
const struct iovec *  iov,
int  iovcnt,
uint16_t  timeout = 0 
)

Write scattered buffers in one operation - sync

Parameters:
offset offset from the beginning of the file
iov list of the buffers to be written
iovcnt number of buffers
handler handler to be notified when the response arrives
timeout timeout value, if 0 then the environment default will be used
Returns:
status of the operation
XRootDStatus XrdCl::File::WriteV ( uint64_t  offset,
const struct iovec *  iov,
int  iovcnt,
ResponseHandler handler,
uint16_t  timeout = 0 
)

Write scattered buffers in one operation - async

Parameters:
offset offset from the beginning of the file
iov list of the buffers to be written
iovcnt number of buffers
handler handler to be notified when the response arrives
timeout timeout value, if 0 then the environment default will be used
Returns:
status of the operation

Member Data Documentation

FilePlugIn* XrdCl::File::pPlugIn [private]
FileStateHandler* XrdCl::File::pStateHandler [private]

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

Generated on 11 Jul 2018 for xrootd by  doxygen 1.6.1