Logo ROOT   6.16/01
Reference Guide
TRFIOFile.h
Go to the documentation of this file.
1// @(#)root/rfio:$Id$
2// Author: Fons Rademakers 20/01/99 + Giulia Taurelli 29/06/2006
3
4/*************************************************************************
5 * Copyright (C) 1995-2000, 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#ifndef ROOT_TRFIOFile
13#define ROOT_TRFIOFile
14
15#include "Compression.h"
16#include "TFile.h"
17#include "TSystem.h"
18
19
20class TRFIOFile : public TFile {
21
22private:
24
25 // Interface to basic system I/O routines
26 Int_t SysOpen(const char *pathname, Int_t flags, UInt_t mode);
28 Int_t SysRead(Int_t fd, void *buf, Int_t len);
29 Int_t SysWrite(Int_t fd, const void *buf, Int_t len);
30 Long64_t SysSeek(Int_t fd, Long64_t offset, Int_t whence);
31 Int_t SysStat(Int_t fd, Long_t *id, Long64_t *size, Long_t *flags, Long_t *modtime);
32 Int_t SysSync(Int_t) { /* no fsync for RFIO */ return 0; }
33 Bool_t ReadBuffers(char *buf, Long64_t *pos, Int_t *len, Int_t nbuf);
34
35public:
36 TRFIOFile(const char *url, Option_t *option="",
37 const char *ftitle="", Int_t compress = ROOT::RCompressionSetting::EDefaults::kUseGeneralPurpose);
38 ~TRFIOFile();
39
40 Int_t GetErrno() const;
41 void ResetErrno() const;
42
43 ClassDef(TRFIOFile,1) //A ROOT file that reads/writes via a rfiod server
44};
45
46/**
47\class TRFIOSystem
48\ingroup IO
49
50Directory handler for RFIO
51*/
52
53class TRFIOSystem : public TSystem {
54
55private:
56 void *fDirp; // directory handler
57
58 void *GetDirPtr() const { return fDirp; }
59
60public:
62 virtual ~TRFIOSystem() { }
63
64 Int_t MakeDirectory(const char *name);
65 void *OpenDirectory(const char *name);
66 void FreeDirectory(void *dirp);
67 const char *GetDirEntry(void *dirp);
68 Int_t GetPathInfo(const char *path, FileStat_t &buf);
69 Bool_t AccessPathName(const char *path, EAccessMode mode);
70 Int_t Unlink(const char *path);
71
72 ClassDef(TRFIOSystem,0) // Directory handler for RFIO
73};
74
75#endif
int Int_t
Definition: RtypesCore.h:41
unsigned int UInt_t
Definition: RtypesCore.h:42
long Long_t
Definition: RtypesCore.h:50
bool Bool_t
Definition: RtypesCore.h:59
long long Long64_t
Definition: RtypesCore.h:69
const char Option_t
Definition: RtypesCore.h:62
#define ClassDef(name, id)
Definition: Rtypes.h:324
EAccessMode
Definition: TSystem.h:44
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format.
Definition: TFile.h:48
A ROOT file that reads/writes via a rfiod server.
Definition: TRFIOFile.h:20
Int_t SysClose(Int_t fd)
Interface to system close. All arguments like in POSIX close.
Definition: TRFIOFile.cxx:311
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
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
Int_t GetErrno() const
Method returning rfio_errno.
Definition: TRFIOFile.cxx:393
~TRFIOFile()
RFIO file dtor. Close and flush directory structure.
Definition: TRFIOFile.cxx:197
Int_t SysSync(Int_t)
Interface to system fsync. All arguments like in POSIX fsync().
Definition: TRFIOFile.h:32
void ResetErrno() const
Method resetting the rfio_errno, serrno and errno.
Definition: TRFIOFile.cxx:405
TRFIOFile()
Definition: TRFIOFile.h:23
Long64_t SysSeek(Int_t fd, Long64_t offset, Int_t whence)
Interface to system lseek.
Definition: TRFIOFile.cxx:346
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
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
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
Directory handler for RFIO.
Definition: TRFIOFile.h:53
virtual ~TRFIOSystem()
Definition: TRFIOFile.h:62
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
void * GetDirPtr() const
Definition: TRFIOFile.h:58
void * OpenDirectory(const char *name)
Open a directory via rfiod.
Definition: TRFIOFile.cxx:440
void * fDirp
Definition: TRFIOFile.h:56
TRFIOSystem()
Create helper class that allows directory access via rfiod.
Definition: TRFIOFile.cxx:417
const char * GetDirEntry(void *dirp)
Get directory entry via rfiod. Returns 0 in case no more entries.
Definition: TRFIOFile.cxx:483
Int_t MakeDirectory(const char *name)
Make a directory via rfiod.
Definition: TRFIOFile.cxx:427
Int_t GetPathInfo(const char *path, FileStat_t &buf)
Get info about a file.
Definition: TRFIOFile.cxx:507
Int_t Unlink(const char *path)
Unlink, i.e.
Definition: TRFIOFile.cxx:546
void FreeDirectory(void *dirp)
Free directory via rfiod.
Definition: TRFIOFile.cxx:467
Abstract base class defining a generic interface to the underlying Operating System.
Definition: TSystem.h:248
@ kUseGeneralPurpose
Use the recommended general-purpose setting; moderate read / write speed and compression ratio.
Definition: Compression.h:53