ROOT  6.06/09
Reference Guide
TChirpFile.h
Go to the documentation of this file.
1 // @(#)root/chirp:$Id$
2 // Author: Dan Bradley, Michael Albrecht, Douglas Thain
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2002, 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_TChirpFile
13 #define ROOT_TChirpFile
14 
15 #ifndef ROOT_TFile
16 #include "TFile.h"
17 #endif
18 
19 #ifndef ROOT_TSystem
20 #include "TSystem.h"
21 #endif
22 
23 class TChirpFile:public TFile {
24 private:
25  TChirpFile();
26  struct chirp_file *chirp_file_ptr;
27 
28  Int_t SysOpen(const char *pathname, Int_t flags, UInt_t mode);
29  Int_t SysClose(Int_t fd);
30  Int_t SysRead(Int_t fd, void *buf, Int_t len);
31  Int_t SysWrite(Int_t fd, const void *buf, Int_t len);
32  Long64_t SysSeek(Int_t fd, Long64_t offset, Int_t whence);
33  Int_t SysStat(Int_t fd, Long_t * id, Long64_t * size, Long_t * flags, Long_t * modtime);
34  Int_t SysSync(Int_t fd);
35 
36 public:
37  TChirpFile(const char *path, Option_t * option = "", const char *ftitle = "", Int_t compress = 1);
38 
39  ~TChirpFile();
40 
41  Bool_t ReadBuffers(char *buf, Long64_t * pos, Int_t * len, Int_t nbuf);
42 
44 };
45 
46 
47 class TChirpSystem:public TSystem {
48 public:
49  TChirpSystem();
50  virtual ~ TChirpSystem();
51 
52  Int_t MakeDirectory(const char *name);
53  void *OpenDirectory(const char *name);
54  void FreeDirectory(void *dirp);
55  const char *GetDirEntry(void *dirp);
56  Int_t GetPathInfo(const char *path, FileStat_t & buf);
57  Bool_t AccessPathName(const char *path, EAccessMode mode);
58  Int_t Unlink(const char *path);
59 
60  int Rename(const char *from, const char *to);
61  int Link(const char *from, const char *to);
62  int Symlink(const char *from, const char *to);
63  int GetFsInfo(const char *path, Long_t * id, Long_t * bsize, Long_t * blocks, Long_t * bfree);
64  int Chmod(const char *file, UInt_t mode);
65  int Utime(const char *file, Long_t modtime, Long_t actime);
66 
68 };
69 
70 #endif
Int_t SysClose(Int_t fd)
Interface to system close. All arguments like in POSIX close().
Definition: TChirpFile.cxx:209
Int_t Unlink(const char *path)
Unlink, i.e. remove, a file.
Definition: TChirpFile.cxx:377
long long Long64_t
Definition: RtypesCore.h:69
Int_t SysStat(Int_t fd, Long_t *id, Long64_t *size, Long_t *flags, Long_t *modtime)
Return file stat information.
Definition: TChirpFile.cxx:268
Int_t SysRead(Int_t fd, void *buf, Int_t len)
Interface to system read. All arguments like in POSIX read().
Definition: TChirpFile.cxx:216
int Link(const char *from, const char *to)
Create a link from file1 to file2.
Definition: TChirpFile.cxx:404
const char Option_t
Definition: RtypesCore.h:62
void * OpenDirectory(const char *name)
Open a directory. Returns 0 if directory does not exist.
Definition: TChirpFile.cxx:310
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
Definition: TFile.h:45
Bool_t AccessPathName(const char *path, EAccessMode mode)
Returns FALSE if one can access a file using the specified access mode.
Definition: TChirpFile.cxx:358
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
Bool_t ReadBuffers(char *buf, Long64_t *pos, Int_t *len, Int_t nbuf)
Read the nbuf blocks described in arrays pos and len.
Definition: TChirpFile.cxx:169
Int_t SysSync(Int_t fd)
Interface to system fsync. All arguments like in POSIX fsync().
Definition: TChirpFile.cxx:261
#define ClassDef(name, id)
Definition: Rtypes.h:254
Read and write data via a Chirp server.
Definition: TChirpFile.h:23
Int_t bsize[]
Definition: SparseFit4.cxx:31
int Rename(const char *from, const char *to)
Rename a file.
Definition: TChirpFile.cxx:389
Int_t GetPathInfo(const char *path, FileStat_t &buf)
Get info about a file.
Definition: TChirpFile.cxx:337
void FreeDirectory(void *dirp)
Free a directory.
Definition: TChirpFile.cxx:318
const char * GetDirEntry(void *dirp)
Get a directory entry. Returns 0 if no more entries.
Definition: TChirpFile.cxx:325
unsigned int UInt_t
Definition: RtypesCore.h:42
virtual ~TChirpSystem()
Definition: TChirpFile.cxx:296
Long64_t SysSeek(Int_t fd, Long64_t offset, Int_t whence)
Interface to system lseek.
Definition: TChirpFile.cxx:234
struct chirp_file * chirp_file_ptr
Definition: TChirpFile.h:26
long Long_t
Definition: RtypesCore.h:50
Int_t MakeDirectory(const char *name)
Make a directory.
Definition: TChirpFile.cxx:302
EAccessMode
Definition: TSystem.h:54
#define name(a, b)
Definition: linkTestLib0.cpp:5
int Utime(const char *file, Long_t modtime, Long_t actime)
Set the a files modification and access times.
Definition: TChirpFile.cxx:460
int Symlink(const char *from, const char *to)
Create a symbolic link from file1 to file2.
Definition: TChirpFile.cxx:419
~TChirpFile()
Destructor.
Definition: TChirpFile.cxx:162
Int_t SysWrite(Int_t fd, const void *buf, Int_t len)
Interface to system write. All arguments like in POSIX write().
Definition: TChirpFile.cxx:225
int GetFsInfo(const char *path, Long_t *id, Long_t *bsize, Long_t *blocks, Long_t *bfree)
Get info about a file system: fs type, block size, number of blocks, number of free blocks...
Definition: TChirpFile.cxx:434
Int_t SysOpen(const char *pathname, Int_t flags, UInt_t mode)
Interface to system open. All arguments like in POSIX open().
Definition: TChirpFile.cxx:196
Abstract base class defining a generic interface to the underlying Operating System.
Definition: TSystem.h:258
int Chmod(const char *file, UInt_t mode)
Set the file permission bits. Returns -1 in case or error, 0 otherwise.
Definition: TChirpFile.cxx:452