XrdDigFile Class Reference

#include <XrdDigFS.hh>

Inheritance diagram for XrdDigFile:
Inheritance graph
[legend]
Collaboration diagram for XrdDigFile:
Collaboration graph
[legend]

List of all members.

Public Member Functions

int open (const char *fileName, XrdSfsFileOpenMode openMode, mode_t createMode, const XrdSecClientName *client=0, const char *opaque=0)
int close ()
int fctl (const int cmd, const char *args, XrdOucErrInfo &out_error)
const char * FName ()
int getMmap (void **Addr, off_t &Size)
int read (XrdSfsFileOffset fileOffset, XrdSfsXferSize preread_sz)
XrdSfsXferSize read (XrdSfsFileOffset fileOffset, char *buffer, XrdSfsXferSize buffer_size)
int read (XrdSfsAio *aioparm)
XrdSfsXferSize readv (XrdOucIOVec *readV, int readCount)
XrdSfsXferSize write (XrdSfsFileOffset fileOffset, const char *buffer, XrdSfsXferSize buffer_size)
int write (XrdSfsAio *aioparm)
int sync ()
int sync (XrdSfsAio *aiop)
int stat (struct stat *buf)
int truncate (XrdSfsFileOffset fileOffset)
int getCXinfo (char cxtype[4], int &cxrsz)
 XrdDigFile (char *user=0, int monid=0)
 ~XrdDigFile ()

Private Attributes

int oh
char * fname
bool isProc

Constructor & Destructor Documentation

XrdDigFile::XrdDigFile ( char *  user = 0,
int  monid = 0 
) [inline]
XrdDigFile::~XrdDigFile (  )  [inline]

References close(), and oh.


Member Function Documentation

int XrdDigFile::close (  )  [virtual]

Close the file.

Returns:
One of SFS_OK or SFS_ERROR.

Implements XrdSfsFile.

Referenced by ~XrdDigFile().

int XrdDigFile::fctl ( const int  cmd,
const char *  args,
XrdOucErrInfo eInfo 
) [virtual]

Execute a special operation on the file (version 1)

Parameters:
cmd - The operation to be performed (see below). SFS_FCTL_GETFD Return file descriptor if possible SFS_FCTL_STATV Reserved for future use.
args - specific arguments to cmd SFS_FCTL_GETFD Set to zero.
eInfo - The object where error info or results are to be returned. This is legacy and the error onject may be used as well.
Returns:
If an error occurs or the operation is not support, SFS_ERROR should be returned with error.code set to errno. Otherwise, SFS_FCTL_GETFD error.code holds the real file descriptor number If the value is negative, sendfile() is not used. If the value is SFS_SFIO_FDVAL then the SendData() method is used for future read requests.

Implements XrdSfsFile.

const char* XrdDigFile::FName (  )  [inline, virtual]

Get the file path.

Returns:
Null terminated string of the path used in open().

Implements XrdSfsFile.

References fname.

int XrdDigFile::getCXinfo ( char  cxtype[4],
int &  cxrsz 
) [inline, virtual]

Get compression information for the file.

Parameters:
cxtype - Place where the compression algorithm name is to be placed
cxrsz - Place where the compression page size is to be returned
Returns:
One of the valid SFS return codes described above. If the file is not compressed or an error is returned, cxrsz must be set to 0.

Implements XrdSfsFile.

int XrdDigFile::getMmap ( void **  Addr,
off_t &  Size 
) [inline, virtual]

Get file's memory mapping if one exists (memory mapped files only).

Parameters:
addr - Place where the starting memory address is returned.
size - Place where the file's size is returned.
Returns:
SFS_OK when the file is memory mapped or any other code otherwise.

Implements XrdSfsFile.

References SFS_OK.

int XrdDigFile::open ( const char *  fileName,
XrdSfsFileOpenMode  openMode,
mode_t  createMode,
const XrdSecClientName *  client = 0,
const char *  opaque = 0 
)
int XrdDigFile::read ( XrdSfsAio aioparm  )  [virtual]

Read file bytes using asynchronous I/O.

Parameters:
aioparm - Pointer to async I/O object controlling the I/O.
Returns:
SFS_OK Request accepted and will be scheduled.
SFS_ERROR File could not be read, error holds the reason.

Implements XrdSfsFile.

XrdSfsXferSize XrdDigFile::read ( XrdSfsFileOffset  offset,
char *  buffer,
XrdSfsXferSize  size 
) [virtual]

Read file bytes into a buffer.

Parameters:
offset - The offset where the read is to start.
buffer - pointer to buffer where the bytes are to be placed.
size - The number of bytes to read.
Returns:
>= 0 The number of bytes that placed in buffer.
SFS_ERROR File could not be read, error holds the reason.

Implements XrdSfsFile.

int XrdDigFile::read ( XrdSfsFileOffset  offset,
XrdSfsXferSize  size 
) [inline, virtual]

Preread file blocks into the file system cache.

Parameters:
offset - The offset where the read is to start.
size - The number of bytes to pre-read.
Returns:
>= 0 The number of bytes that will be pre-read.
SFS_ERROR File could not be preread, error holds the reason.

Implements XrdSfsFile.

References SFS_OK.

XrdSfsXferSize XrdDigFile::readv ( XrdOucIOVec readV,
int  rdvCnt 
) [virtual]

Given an array of read requests (size rdvCnt), read them from the file and place the contents consecutively in the provided buffer. A dumb default implementation is supplied but should be replaced to increase performance.

Parameters:
readV pointer to the array of read requests.
rdvcnt the number of elements in readV.
Returns:
>=0 The numbe of bytes placed into the buffer.
SFS_ERROR File could not be read, error holds the reason.

Reimplemented from XrdSfsFile.

int XrdDigFile::stat ( struct stat *  buf  )  [virtual]

Return state information on the file.

Parameters:
buf - Pointer to the structure where info it to be returned.
Returns:
One of SFS_OK, SFS_ERROR, SFS_REDIRECT, or SFS_STALL. When SFS_OK is returned, buf must hold stat information.

Implements XrdSfsFile.

int XrdDigFile::sync ( XrdSfsAio aiop  )  [inline, virtual]

Make sure all outstanding data is actually written to the file (async).

Returns:
SFS_OK Request accepted and will be scheduled.
SFS_ERROR Request could not be accepted, return error has reason.

Implements XrdSfsFile.

References SFS_OK.

int XrdDigFile::sync (  )  [inline, virtual]

Make sure all outstanding data is actually written to the file (sync).

Returns:
One of SFS_OK, SFS_ERROR, SFS_REDIRECT, SFS_STALL, or SFS_STARTED

Implements XrdSfsFile.

References SFS_OK.

int XrdDigFile::truncate ( XrdSfsFileOffset  fsize  )  [inline, virtual]

Truncate the file.

Parameters:
fsize - The size that the file is to have.
Returns:
One of SFS_OK, SFS_ERROR, SFS_REDIRECT, or SFS_STALL

Implements XrdSfsFile.

References SFS_OK.

int XrdDigFile::write ( XrdSfsAio aioparm  )  [inline, virtual]

Write file bytes using asynchronous I/O.

Parameters:
aioparm - Pointer to async I/O object controlling the I/O.
Returns:
0 Request accepted and will be scheduled.
!0 Request not accepted, returned value is errno.

Implements XrdSfsFile.

References SFS_OK.

XrdSfsXferSize XrdDigFile::write ( XrdSfsFileOffset  offset,
const char *  buffer,
XrdSfsXferSize  size 
) [inline, virtual]

Write file bytes from a buffer.

Parameters:
offset - The offset where the write is to start.
buffer - pointer to buffer where the bytes reside.
size - The number of bytes to write.
Returns:
>= 0 The number of bytes that were written.
SFS_ERROR File could not be written, error holds the reason.

Implements XrdSfsFile.

References SFS_OK.


Member Data Documentation

char* XrdDigFile::fname [private]

Referenced by FName().

bool XrdDigFile::isProc [private]
int XrdDigFile::oh [private]

Referenced by ~XrdDigFile().


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 7 Jul 2020 for xrootd by  doxygen 1.6.1