14 #ifndef ROOT_TDCacheFile
15 #define ROOT_TDCacheFile
23 #define RAHEAD_BUFFER_SIZE 131072
25 class TDCacheFile :
public TFile {
29 struct stat64 fStatBuffer;
31 TDCacheFile() : fStatCached(kFALSE) { }
34 Int_t SysOpen(
const char *pathname, Int_t flags, UInt_t mode);
35 Int_t SysClose(Int_t fd);
36 Int_t SysRead(Int_t fd,
void *buf, Int_t len);
37 Int_t SysWrite(Int_t fd,
const void *buf, Int_t len);
38 Long64_t SysSeek(Int_t fd, Long64_t offset, Int_t whence);
39 Int_t SysStat(Int_t fd, Long_t *
id, Long64_t *size, Long_t *flags, Long_t *modtime);
40 Int_t SysSync(Int_t fd);
43 TDCacheFile(
const char *path, Option_t *option=
"",
44 const char *ftitle=
"", Int_t compress = ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault);
48 Bool_t ReadBuffer(
char *buf, Int_t len);
49 Bool_t ReadBuffer(
char *buf, Long64_t pos, Int_t len);
50 Bool_t WriteBuffer(
const char *buf, Int_t len);
52 Bool_t ReadBuffers(
char *buf, Long64_t *pos, Int_t *len, Int_t nbuf);
54 void ResetErrno()
const;
56 static Bool_t Stage(
const char *path, UInt_t secs,
57 const char *location = 0);
58 static Bool_t CheckFile(
const char *path,
const char *location = 0);
67 static void SetOpenTimeout(UInt_t secs);
68 static void SetOnError(EOnErrorAction = kOnErrorDefault);
70 static void SetReplyHostName(
const char *host_name);
71 static const char *GetDcapVersion();
72 static TString GetDcapPath(
const char *path);
75 ClassDef(TDCacheFile,1)
79 class TDCacheSystem :
public TSystem {
84 void *GetDirPtr()
const {
return fDirp; }
88 virtual ~TDCacheSystem() { }
90 Int_t MakeDirectory(
const char *name);
91 void *OpenDirectory(
const char *name);
92 void FreeDirectory(
void *dirp);
93 const char *GetDirEntry(
void *dirp);
94 Int_t GetPathInfo(
const char *path, FileStat_t &buf);
95 Bool_t AccessPathName(
const char *path, EAccessMode mode);
97 ClassDef(TDCacheSystem,0)