10 #include <XrdPosix/XrdPosixExtern.hh>
16 extern int rfio_fread(
void*,
size_t,
size_t,
void*);
33 char* chaux =
new char[strlen(path)+1];
35 char* prefix = strtok(chaux,
":");
39 if (strlen(prefix)<strlen(path)) filename = strtok(0,
":");
42 if (strcmp(prefix,
"rfio")==0)
rfioFlag =
true;
43 if (strcmp(prefix,
"castor")==0)
rfioFlag =
true;
44 if (strcmp(prefix,
"root")==0)
xrootdFlag =
true;
57 cout <<
"RawFile: the input file '" << path <<
"' is not present" << endl;
59 cout <<
"RawFile: DAQ file '" << path <<
"' was succesfully opened" << endl;
96 return XrdPosix_Fread(data,nbytes,1,
inputFile);
101 return fread(data, nbytes, 1,
inputFile);
107 return XrdPosix_Fseek(
inputFile, offset, whence);
bool ok()
It is OK (i.e. file was correctly opened)
int rfio_fread(void *, size_t, size_t, void *)
long rfio_ftell(FILE *fp)
RawFile * open(const char *path)
Open file.
virtual ~RawFile()
Destructor.
int read(void *data, size_t nbytes)
Read from file.
long tell()
Tell instruction.
FILE * GetPointer()
Get file pointer.
int rfio_fclose(FILE *fd)
bool isRFIO()
Castor flag.
int close()
Close file if necessary.
int seek(long offset, int whence)
Go somewhere.
FILE * rfio_fopen(char *path, char *mode)
int eof()
Check end of file.
int ignore(long offset)
Ignore some bytes.
int rfio_fseek(FILE *fp, long offset, int whence)
volatile std::atomic< bool > shutdown_flag false
RawFile()
Default constructor.
bool isXROOTD()
XROOTD flag.