Logo ROOT   6.12/07
Reference Guide
TRFIOFile.cxx
Go to the documentation of this file.
1 // @(#)root/rfio:$Id$
2 // Author: Fons Rademakers 20/01/99 + Giulia Taurelli 29/06/2006 + Andreas Peters 07/12/2007
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 /**
13 \class TRFIOFile
14 \ingroup IO
15 A ROOT file that reads/writes via a rfiod server.
16 
17 A TRFIOFile is like a normal TFile except that it reads and writes
18 its data via a rfiod server.
19 TRFIOFile file names are in standard URL format with protocol "rfio". The following are
20 valid TRFIOFile URL's:
21 ~~~ {.bash}
22 rfio:/afs/cern.ch/user/r/rdm/galice.root
23 # where galice.root is a symlink of the type /shift/.../...
24 rfio:na49db1:/data1/raw.root
25 rfio:/castor/cern.ch/user/r/rdm/test.root
26 ~~~
27 If Castor 2.1 is used the file names can be given also in the
28 following ways:
29 ~~~ {.bash}
30 rfio://host:port/?path=FILEPATH
31 rfio://host/?path=FILEPATH
32 rfio:///castor?path=FILEPATH
33 rfio://stager_host:stager_port/?path=/castor/cern.ch/user/r/rdm/bla.root&svcClass=MYSVCLASS&castorVersion=MYCASTORVERSION
34 rfio://stager_host/?path=/castor/cern.ch/user/r/rdm/bla.root&svcClass=MYSVCLASS&castorVersion=MYCASTORVERSION
35 rfio:///castor?path=/castor/cern.ch/user/r/rdm/bla.root&svcClass=MYSVCLASS&castorVersion=MYCASTORVERSION
36 ~~~
37 path is mandatory as parameter but all the other ones are optional.
38 For the ultimate description of supported urls see: https://twiki.cern.ch/twiki/bin/view/FIOgroup/RfioRootTurl
39 */
40 
41 #include "TRFIOFile.h"
42 #include "TROOT.h"
43 #include "TTimeStamp.h"
44 #include "TVirtualPerfStats.h"
45 
46 #include <sys/stat.h>
47 #include <sys/types.h>
48 #include <stdlib.h>
49 #ifndef R__WIN32
50 #include <unistd.h>
51 #if defined(R__SUN) || defined(R__HPUX) || \
52  defined(R__AIX) || defined(R__LINUX) || defined(R__SOLARIS) || \
53  defined(R__HIUX) || defined(R__FBSD) || defined(R__MACOSX) || \
54  defined(R__HURD) || defined(R__OBSD)
55 #define HAS_DIRENT
56 #endif
57 #endif
58 
59 #ifdef HAS_DIRENT
60 #include <dirent.h>
61 #endif
62 
63 #include <rfio.h>
64 #include <rfio_api.h>
65 #include <serrno.h>
66 
67 
70 
71 ////////////////////////////////////////////////////////////////////////////////
72 /// Create a RFIO file object.
73 ///
74 /// A RFIO file is the same as a TFile
75 /// except that it is being accessed via a rfiod server. The url
76 /// argument must be of the form: rfio:/path/file.root (where file.root
77 /// is a symlink of type /shift/aaa/bbb/ccc) or rfio:server:/path/file.root.
78 /// If the file specified in the URL does not exist, is not accessable
79 /// or can not be created the kZombie bit will be set in the TRFIOFile
80 /// object. Use IsZombie() to see if the file is accessable.
81 /// For a description of the option and other arguments see the TFile ctor.
82 /// The preferred interface to this constructor is via TFile::Open().
83 
84 TRFIOFile::TRFIOFile(const char *url, Option_t *option, const char *ftitle,
85  Int_t compress)
86  : TFile(url, "NET", ftitle, compress)
87 {
88  fOption = option;
89  fOption.ToUpper();
90 
91  Int_t readopt = RFIO_READBUF;
92  ::rfiosetopt(RFIO_READOPT, &readopt, 4);
93 
94  if (fOption == "NEW")
95  fOption = "CREATE";
96 
97  Bool_t create = (fOption == "CREATE") ? kTRUE : kFALSE;
98  Bool_t recreate = (fOption == "RECREATE") ? kTRUE : kFALSE;
99  Bool_t update = (fOption == "UPDATE") ? kTRUE : kFALSE;
100  Bool_t read = (fOption == "READ") ? kTRUE : kFALSE;
101  if (!create && !recreate && !update && !read) {
102  read = kTRUE;
103  fOption = "READ";
104  }
105 
106  // to be able to use the turl starting with castor:
107  if (!strcmp(fUrl.GetProtocol(), "castor"))
108  fUrl.SetProtocol("rfio");
109 
110  // old RFIO client does not ignore ?filetpye=raw, remove it
111  TString opt = fUrl.GetOptions();
112  if (opt.Contains("&filetype=raw")) {
113  opt.ReplaceAll("&filetype=raw", "");
114  fUrl.SetOptions(opt);
115  } else if (opt.Contains("filetype=raw")) {
116  opt.ReplaceAll("filetype=raw", "");
117  fUrl.SetOptions(opt);
118  }
119 
120  // old RFIO client lib does not support :///, need to change to :////
121  Bool_t addSlash = kFALSE;
122  if ((strstr(url, ":/") && !strstr(url, "://")) ||
123  (strstr(url, ":///") && !strstr(url, ":////")))
124  addSlash = kTRUE;
125 
126  // the complete turl in fname
127  TString fname;
128  if (!addSlash)
129  fname.Form("%s://%s", fUrl.GetProtocol(), fUrl.GetFile());
130  else
131  fname.Form("%s:///%s", fUrl.GetProtocol(), fUrl.GetFile());
132  if (strlen(fUrl.GetOptions()))
133  fname += TString::Format("?%s", fUrl.GetOptions());
134 
135  if (recreate) {
136  if (::rfio_access((char*)fname.Data(), kFileExists) == 0)
137  ::rfio_unlink((char*)fname.Data());
138  recreate = kFALSE;
139  create = kTRUE;
140  fOption = "CREATE";
141  }
142  if (create && ::rfio_access((char*)fname.Data(), kFileExists) == 0) {
143  Error("TRFIOFile", "file %s already exists", fname.Data());
144  goto zombie;
145  }
146  if (update) {
147  if (::rfio_access((char*)fname.Data(), kFileExists) != 0) {
148  update = kFALSE;
149  create = kTRUE;
150  }
151  if (update && ::rfio_access((char*)fname.Data(), kWritePermission) != 0) {
152  Error("TRFIOFile", "no write permission, could not open file %s", fname.Data());
153  goto zombie;
154  }
155  }
156 
157  // Connect to file system stream
158  fRealName = fname;
159 
160  if (create || update) {
161 #ifndef WIN32
162  fD = SysOpen(fname.Data(), O_RDWR | O_CREAT, 0644);
163 #else
164  fD = SysOpen(fname.Data(), O_RDWR | O_CREAT | O_BINARY, S_IREAD | S_IWRITE);
165 #endif
166  if (fD == -1) {
167  SysError("TRFIOFile", "file %s can not be opened", fname.Data());
168  goto zombie;
169  }
170  fWritable = kTRUE;
171  } else {
172 #ifndef WIN32
173  fD = SysOpen(fname.Data(), O_RDONLY, 0644);
174 #else
175  fD = SysOpen(fname.Data(), O_RDONLY | O_BINARY, S_IREAD | S_IWRITE);
176 #endif
177  if (fD == -1) {
178  SysError("TRFIOFile", "file %s can not be opened for reading", fname.Data());
179  goto zombie;
180  }
181  fWritable = kFALSE;
182  }
183 
184  Init(create);
185 
186  return;
187 
188 zombie:
189  // error in file opening occured, make this object a zombie
190  MakeZombie();
191  gDirectory = gROOT;
192 }
193 
194 ////////////////////////////////////////////////////////////////////////////////
195 /// RFIO file dtor. Close and flush directory structure.
196 
198 {
199  Close();
200 }
201 
202 ////////////////////////////////////////////////////////////////////////////////
203 /// Read a list of buffers given in pos[] and len[] and return it
204 /// in a single buffer. Returns kTRUE in case of error.
205 
206 Bool_t TRFIOFile::ReadBuffers(char *buf, Long64_t *pos, Int_t *len, Int_t nbuf)
207 {
208  TTHREAD_TLS(struct iovec64 *) iov = 0;
209  TTHREAD_TLS(Int_t) iovsize = 128;
210  Int_t n;
211 
212  if (IsZombie()) {
213  Error("ReadBuffers", "cannot read because object is in 'zombie' state");
214  return kTRUE;
215  }
216 
217  if (!IsOpen()) {
218  Error("ReadBuffers", "the remote file is not open");
219  return kTRUE;
220  }
221 
222  Double_t start = 0;
223  if (gPerfStats) start = TTimeStamp();
224 
225  // we maintain a static iove64 buffer to avoid malloc/free with every call
226  if (!iov) {
227  if (nbuf > iovsize)
228  iovsize = nbuf;
229 
230  iov = (struct iovec64*)malloc(sizeof(struct iovec64) * iovsize);
231  if (gDebug > 1)
232  Info("TRFIOFile", "allocating iovec64 with size %d", iovsize);
233  if (!iov) {
234  Error("TRFIOFile", "error allocating preseek vector of size %ld",
235  (Long_t)sizeof(struct iovec64) * iovsize);
236  return kTRUE;
237  }
238  } else {
239  if (nbuf > iovsize) {
240  iovsize = nbuf;
241  iov = (struct iovec64*) realloc(iov, sizeof(struct iovec64) * iovsize);
242  if (gDebug > 1)
243  Info("TRFIOFile", "re-allocating iovec64 with size %d", iovsize);
244  if (!iov) {
245  Error("TRFIOFile", "error reallocating preseek vector of size %ld",
246  (Long_t)sizeof(struct iovec64) * iovsize);
247  return kTRUE;
248  }
249  }
250  }
251 
252  for (n = 0; n < nbuf; n++) {
253  if (gDebug>1)
254  Info("TFIOFile", "adding chunk %d, %lld %d", n, pos[n], len[n]);
255  iov[n].iov_base = pos[n] + fArchiveOffset;
256  iov[n].iov_len = len[n];
257  }
258 
259  // prefetch the stuff if preseek is supported,
260  // preseek support was removed from client and server in castor 2.1.15
261  if (rfio_preseek64(fD, iov, nbuf) < 0 && rfio_errno != SEOPNOTSUP) {
262  Error("TRFIOFile", "error doing rfio_preseek64");
263  return kTRUE;
264  }
265 
266  // read the chunks
267  Int_t k = 0;
268 
269  for (n = 0; n < nbuf; n++) {
270  if (rfio_lseek64(fD, iov[n].iov_base, SEEK_SET) < 0) {
271  Error("TRFIOFile", "error doing rfio_lseek64");
272  return kTRUE;
273  }
274  if (rfio_read(fD, buf+k, iov[n].iov_len) < 0) {
275  Error("TRFIOFile", "error doing rfio_read");
276  return kTRUE;
277  }
278  k += iov[n].iov_len;
279  }
280 
281  fBytesRead += k;
282  fReadCalls++;
283 #ifdef WIN32
286 #else
287  fgBytesRead += k;
288  fgReadCalls++;
289 #endif
290 
291  if (gPerfStats)
292  gPerfStats->FileReadEvent(this, k, start);
293 
294  return kFALSE;
295 }
296 
297 ////////////////////////////////////////////////////////////////////////////////
298 /// Interface to system open. All arguments like in POSIX open.
299 
300 Int_t TRFIOFile::SysOpen(const char *pathname, Int_t flags, UInt_t mode)
301 {
302  Int_t ret = ::rfio_open64((char*)pathname, flags, (Int_t) mode);
303  if (ret < 0)
304  gSystem->SetErrorStr(::rfio_serror());
305  return ret;
306 }
307 
308 ////////////////////////////////////////////////////////////////////////////////
309 /// Interface to system close. All arguments like in POSIX close.
310 
312 {
313  Int_t ret = ::rfio_close(fd);
314  if (ret < 0)
315  gSystem->SetErrorStr(::rfio_serror());
316  return ret;
317 }
318 
319 ////////////////////////////////////////////////////////////////////////////////
320 /// Interface to system read. All arguments like in POSIX read.
321 
322 Int_t TRFIOFile::SysRead(Int_t fd, void *buf, Int_t len)
323 {
324  Int_t ret = ::rfio_read(fd, (char *)buf, len);
325  if (ret < 0)
326  gSystem->SetErrorStr(::rfio_serror());
327  return ret;
328 }
329 
330 ////////////////////////////////////////////////////////////////////////////////
331 /// Interface to system write. All arguments like in POSIX write.
332 
333 Int_t TRFIOFile::SysWrite(Int_t fd, const void *buf, Int_t len)
334 {
335  Int_t ret = ::rfio_write(fd, (char *)buf, len);
336  if (ret < 0)
337  gSystem->SetErrorStr(::rfio_serror());
338  return ret;
339 }
340 
341 ////////////////////////////////////////////////////////////////////////////////
342 /// Interface to system lseek. All arguments like in POSIX lseek
343 /// except that the offset and return value are Long_t to be able to
344 /// handle 64 bit file systems.
345 
347 {
348  Long64_t ret = ::rfio_lseek64(fd, offset, whence);
349 
350  if (ret < 0)
351  gSystem->SetErrorStr(::rfio_serror());
352 
353  return ret;
354 }
355 
356 ////////////////////////////////////////////////////////////////////////////////
357 /// Interface to TSystem:GetPathInfo(). Generally implemented via
358 /// stat() or fstat().
359 
361  Long_t *modtime)
362 {
363  struct stat64 statbuf;
364 
365  if (::rfio_fstat64(fd, &statbuf) >= 0) {
366  if (id)
367  *id = (statbuf.st_dev << 24) + statbuf.st_ino;
368  if (size)
369  *size = statbuf.st_size;
370  if (modtime)
371  *modtime = statbuf.st_mtime;
372  if (flags) {
373  *flags = 0;
374  if (statbuf.st_mode & ((S_IEXEC)|(S_IEXEC>>3)|(S_IEXEC>>6)))
375  *flags |= 1;
376  if ((statbuf.st_mode & S_IFMT) == S_IFDIR)
377  *flags |= 2;
378  if ((statbuf.st_mode & S_IFMT) != S_IFREG &&
379  (statbuf.st_mode & S_IFMT) != S_IFDIR)
380  *flags |= 4;
381  }
382  return 0;
383  }
384 
385  gSystem->SetErrorStr(::rfio_serror());
386  return 1;
387 }
388 
389 ////////////////////////////////////////////////////////////////////////////////
390 /// Method returning rfio_errno. For RFIO files must use this
391 /// function since we need to check rfio_errno then serrno and finally errno.
392 
394 {
395  if (rfio_errno)
396  return rfio_errno;
397  if (serrno)
398  return serrno;
399  return TSystem::GetErrno();
400 }
401 
402 ////////////////////////////////////////////////////////////////////////////////
403 /// Method resetting the rfio_errno, serrno and errno.
404 
406 {
407  rfio_errno = 0;
408  serrno = 0;
410 }
411 
412 
413 ////////////////////////////////////////////////////////////////////////////////
414 /// Create helper class that allows directory access via rfiod.
415 /// The name must start with '-' to bypass the TSystem singleton check.
416 
417 TRFIOSystem::TRFIOSystem() : TSystem("-rfio", "RFIO Helper System")
418 {
419  SetName("rfio");
420 
421  fDirp = 0;
422 }
423 
424 ////////////////////////////////////////////////////////////////////////////////
425 /// Make a directory via rfiod.
426 
428 {
429  TUrl url(dir);
430  Int_t ret = ::rfio_mkdir((char*)url.GetFileAndOptions(), 0755);
431  if (ret < 0)
432  gSystem->SetErrorStr(::rfio_serror());
433  return ret;
434 }
435 
436 ////////////////////////////////////////////////////////////////////////////////
437 /// Open a directory via rfiod. Returns an opaque pointer to a dir
438 /// structure. Returns 0 in case of error.
439 
440 void *TRFIOSystem::OpenDirectory(const char *dir)
441 {
442  if (fDirp) {
443  Error("OpenDirectory", "invalid directory pointer (should never happen)");
444  fDirp = 0;
445  }
446 
447  TUrl url(dir);
448 
449  struct stat finfo;
450  if (::rfio_stat((char*)url.GetFileAndOptions(), &finfo) < 0)
451  return 0;
452 
453  if ((finfo.st_mode & S_IFMT) != S_IFDIR)
454  return 0;
455 
456  fDirp = (void*) ::rfio_opendir((char*)url.GetFileAndOptions());
457 
458  if (!fDirp)
459  gSystem->SetErrorStr(::rfio_serror());
460 
461  return fDirp;
462 }
463 
464 ////////////////////////////////////////////////////////////////////////////////
465 /// Free directory via rfiod.
466 
468 {
469  if (dirp != fDirp) {
470  Error("FreeDirectory", "invalid directory pointer (should never happen)");
471  return;
472  }
473 
474  if (dirp)
475  ::rfio_closedir((DIR*)dirp);
476 
477  fDirp = 0;
478 }
479 
480 ////////////////////////////////////////////////////////////////////////////////
481 /// Get directory entry via rfiod. Returns 0 in case no more entries.
482 
483 const char *TRFIOSystem::GetDirEntry(void *dirp)
484 {
485  if (dirp != fDirp) {
486  Error("GetDirEntry", "invalid directory pointer (should never happen)");
487  return 0;
488  }
489 
490  struct dirent *dp;
491 
492  if (dirp) {
493  dp = (struct dirent *) ::rfio_readdir((DIR*)dirp);
494  if (!dp)
495  return 0;
496  return dp->d_name;
497  }
498  return 0;
499 }
500 
501 ////////////////////////////////////////////////////////////////////////////////
502 /// Get info about a file. Info is returned in the form of a FileStat_t
503 /// structure (see TSystem.h).
504 /// The function returns 0 in case of success and 1 if the file could
505 /// not be stat'ed.
506 
508 {
509  TUrl url(path);
510 
511  struct stat64 sbuf;
512  if (path && ::rfio_stat64((char*)url.GetFileAndOptions(), &sbuf) >= 0) {
513 
514  buf.fDev = sbuf.st_dev;
515  buf.fIno = sbuf.st_ino;
516  buf.fMode = sbuf.st_mode;
517  buf.fUid = sbuf.st_uid;
518  buf.fGid = sbuf.st_gid;
519  buf.fSize = sbuf.st_size;
520  buf.fMtime = sbuf.st_mtime;
521  buf.fIsLink = kFALSE;
522 
523  return 0;
524  }
525  return 1;
526 }
527 
528 ////////////////////////////////////////////////////////////////////////////////
529 /// Returns FALSE if one can access a file using the specified access mode.
530 /// Mode is the same as for the Unix access(2) function.
531 /// Attention, bizarre convention of return value!!
532 
534 {
535  TUrl url(path);
536  if (::rfio_access((char*)url.GetFileAndOptions(), mode) == 0)
537  return kFALSE;
538  gSystem->SetErrorStr(::rfio_serror());
539  return kTRUE;
540 }
541 
542 ////////////////////////////////////////////////////////////////////////////////
543 /// Unlink, i.e. remove, a file or directory. Returns 0 when successful,
544 /// -1 in case of failure.
545 
546 Int_t TRFIOSystem::Unlink(const char *path)
547 {
548  TUrl url(path);
549 
550  struct stat finfo;
551  if (rfio_stat((char*)url.GetFileAndOptions(), &finfo) < 0)
552  return -1;
553 
554  if (R_ISDIR(finfo.st_mode))
555  return rfio_rmdir((char*)url.GetFileAndOptions());
556  else
557  return rfio_unlink((char*)url.GetFileAndOptions());
558 }
virtual void SysError(const char *method, const char *msgfmt,...) const
Issue system error message.
Definition: TObject.cxx:894
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
Definition: TObject.cxx:854
TRFIOFile()
Definition: TRFIOFile.h:22
long long Long64_t
Definition: RtypesCore.h:69
void SetProtocol(const char *proto, Bool_t setDefaultPort=kFALSE)
Set protocol and, optionally, change the port accordingly.
Definition: TUrl.cxx:520
static std::atomic< Long64_t > fgBytesRead
Number of bytes read by all TFile objects.
Definition: TFile.h:122
const char Option_t
Definition: RtypesCore.h:62
Int_t SysWrite(Int_t fd, const void *buf, Int_t len)
Interface to system write. All arguments like in POSIX write.
Definition: TRFIOFile.cxx:333
This class represents a WWW compatible URL.
Definition: TUrl.h:35
Int_t fUid
Definition: TSystem.h:129
TString & ReplaceAll(const TString &s1, const TString &s2)
Definition: TString.h:638
const char * GetProtocol() const
Definition: TUrl.h:67
virtual void SetName(const char *name)
Set the name of the TNamed.
Definition: TNamed.cxx:140
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
Definition: TFile.h:46
static void SetFileReadCalls(Int_t readcalls=0)
Definition: TFile.cxx:4458
void ToUpper()
Change string to upper case.
Definition: TString.cxx:1112
void * OpenDirectory(const char *name)
Open a directory via rfiod.
Definition: TRFIOFile.cxx:440
void ResetErrno() const
Method resetting the rfio_errno, serrno and errno.
Definition: TRFIOFile.cxx:405
const char * GetFileAndOptions() const
Return the file and its options (the string specified behind the ?).
Definition: TUrl.cxx:501
#define gROOT
Definition: TROOT.h:402
#define O_BINARY
Definition: civetweb.c:451
Basic string class.
Definition: TString.h:125
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
const char * GetOptions() const
Definition: TUrl.h:74
Long_t fMtime
Definition: TSystem.h:132
void FreeDirectory(void *dirp)
Free directory via rfiod.
Definition: TRFIOFile.cxx:467
Int_t fReadCalls
Number of read calls ( not counting the cache calls )
Definition: TFile.h:82
TRFIOSystem()
Create helper class that allows directory access via rfiod.
Definition: TRFIOFile.cxx:417
#define malloc
Definition: civetweb.c:818
Long64_t fSize
Definition: TSystem.h:131
~TRFIOFile()
RFIO file dtor. Close and flush directory structure.
Definition: TRFIOFile.cxx:197
static Int_t GetErrno()
Static function returning system error number.
Definition: TSystem.cxx:268
Int_t fMode
Definition: TSystem.h:128
const char * GetFile() const
Definition: TUrl.h:72
TUrl fUrl
!URL of file
Definition: TFile.h:103
Int_t fD
File descriptor.
Definition: TFile.h:75
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString...
Definition: TString.cxx:2365
TString fRealName
Effective real file name (not original url)
Definition: TFile.h:83
static Long64_t GetFileBytesRead()
Static function returning the total number of bytes read from all files.
Definition: TFile.cxx:4418
#define realloc
Definition: civetweb.c:820
Int_t fGid
Definition: TSystem.h:130
R__ALWAYS_INLINE Bool_t IsZombie() const
Definition: TObject.h:134
Bool_t AccessPathName(const char *path, EAccessMode mode)
Returns FALSE if one can access a file using the specified access mode.
Definition: TRFIOFile.cxx:533
Int_t SysClose(Int_t fd)
Interface to system close. All arguments like in POSIX close.
Definition: TRFIOFile.cxx:311
Directory handler for RFIO.
Definition: TRFIOFile.h:52
A ROOT file that reads/writes via a rfiod server.
Definition: TRFIOFile.h:19
Bool_t fIsLink
Definition: TSystem.h:133
R__EXTERN TSystem * gSystem
Definition: TSystem.h:540
static void update(gsl_integration_workspace *workspace, double a1, double b1, double area1, double error1, double a2, double b2, double area2, double error2)
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Definition: TString.cxx:2343
unsigned int UInt_t
Definition: RtypesCore.h:42
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:880
static std::atomic< Int_t > fgReadCalls
Number of bytes read from all TFile objects.
Definition: TFile.h:124
static Int_t GetFileReadCalls()
Static function returning the total number of read calls from all files.
Definition: TFile.cxx:4435
virtual void Init(Bool_t create)
Initialize a TFile object.
Definition: TFile.cxx:596
Bool_t fWritable
True if directory is writable.
#define gPerfStats
const Bool_t kFALSE
Definition: RtypesCore.h:88
Int_t Unlink(const char *path)
Unlink, i.e.
Definition: TRFIOFile.cxx:546
long Long_t
Definition: RtypesCore.h:50
virtual Bool_t IsOpen() const
Returns kTRUE in case file is open and kFALSE if file is not open.
Definition: TFile.cxx:1395
#define ClassImp(name)
Definition: Rtypes.h:359
double Double_t
Definition: RtypesCore.h:55
The TTimeStamp encapsulates seconds and ns since EPOCH.
Definition: TTimeStamp.h:71
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition: TString.h:570
TString fOption
File options.
Definition: TFile.h:84
EAccessMode
Definition: TSystem.h:44
Bool_t R_ISDIR(Int_t mode)
Definition: TSystem.h:116
Int_t GetErrno() const
Method returning rfio_errno.
Definition: TRFIOFile.cxx:393
void MakeZombie()
Definition: TObject.h:49
void SetOptions(const char *opt)
Definition: TUrl.h:90
Long64_t SysSeek(Int_t fd, Long64_t offset, Int_t whence)
Interface to system lseek.
Definition: TRFIOFile.cxx:346
Long_t fIno
Definition: TSystem.h:127
R__EXTERN Int_t gDebug
Definition: Rtypes.h:86
Long64_t fArchiveOffset
!Offset at which file starts in archive
Definition: TFile.h:94
static void ResetErrno()
Static function resetting system error number.
Definition: TSystem.cxx:284
#define gDirectory
Definition: TDirectory.h:213
Int_t SysRead(Int_t fd, void *buf, Int_t len)
Interface to system read. All arguments like in POSIX read.
Definition: TRFIOFile.cxx:322
void SetErrorStr(const char *errstr)
Set the system error string.
Definition: TSystem.cxx:249
Int_t GetPathInfo(const char *path, FileStat_t &buf)
Get info about a file.
Definition: TRFIOFile.cxx:507
Long_t fDev
Definition: TSystem.h:126
Int_t SysOpen(const char *pathname, Int_t flags, UInt_t mode)
Interface to system open. All arguments like in POSIX open.
Definition: TRFIOFile.cxx:300
static void SetFileBytesRead(Long64_t bytes=0)
Definition: TFile.cxx:4452
Abstract base class defining a generic interface to the underlying Operating System.
Definition: TSystem.h:248
const Bool_t kTRUE
Definition: RtypesCore.h:87
const Int_t n
Definition: legend1.C:16
Int_t SysStat(Int_t fd, Long_t *id, Long64_t *size, Long_t *flags, Long_t *modtime)
Interface to TSystem:GetPathInfo().
Definition: TRFIOFile.cxx:360
Long64_t fBytesRead
Number of bytes read from this file.
Definition: TFile.h:69
Int_t MakeDirectory(const char *name)
Make a directory via rfiod.
Definition: TRFIOFile.cxx:427
Bool_t ReadBuffers(char *buf, Long64_t *pos, Int_t *len, Int_t nbuf)
Read a list of buffers given in pos[] and len[] and return it in a single buffer. ...
Definition: TRFIOFile.cxx:206
void * fDirp
Definition: TRFIOFile.h:55
virtual void Close(Option_t *option="")
Close a file.
Definition: TFile.cxx:916
const char * GetDirEntry(void *dirp)
Get directory entry via rfiod. Returns 0 in case no more entries.
Definition: TRFIOFile.cxx:483
const char * Data() const
Definition: TString.h:345