11 #include <XrdPosix/XrdPosixExtern.hh> 25 std::unique_ptr<char[]> chaux{
new char[strlen(path)+1] };
26 strcpy(chaux.get(),
path);
28 char*
prefix = strtok_r(chaux.get(),
":",&saveptr);
32 if (strlen(prefix)<strlen(path)) filename = strtok_r(
nullptr,
":",&saveptr);
35 if (strcmp(prefix,
"root")==0)
xrootdFlag =
true;
45 cout <<
"RawFile: the input file '" << path <<
"' is not present" << endl;
47 cout <<
"RawFile: DAQ file '" << path <<
"' was succesfully opened" << endl;
79 return XrdPosix_Fread(data,nbytes,1,
inputFile);
87 return XrdPosix_Fseek(
inputFile, offset, whence);
bool ok()
It is OK (i.e. file was correctly opened)
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 close()
Close file if necessary.
int seek(long offset, int whence)
Go somewhere.
int eof()
Check end of file.
int ignore(long offset)
Ignore some bytes.
char data[epos_bytes_allocation]
RawFile()
Default constructor.
bool isXROOTD()
XROOTD flag.