Logo ROOT  
Reference Guide
TAlienSystem.h
Go to the documentation of this file.
1// @(#)root/base:$Id$
2// Author: Andreas Peters 15/05/2006
3
4/*************************************************************************
5 * Copyright (C) 1995-2006, 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_TAlienSystem
13#define ROOT_TAlienSystem
14
15//////////////////////////////////////////////////////////////////////////
16// //
17// TAlienSystem //
18// //
19// TSystem Implementation of the AliEn GRID plugin. //
20// //
21//////////////////////////////////////////////////////////////////////////
22
23#ifndef __CINT__
24#include <stdio.h>
25#endif
26
27#include "TSystem.h"
28
29class TAlienSystem : public TSystem {
30
31protected:
33
34public:
35 TAlienSystem(const char *name = "Generic", const char *title = "Generic System");
36 virtual ~TAlienSystem();
37
38 //---- Misc
39 virtual Bool_t Init();
40
41 //---- Directories
42 virtual int MakeDirectory(const char *name);
43 virtual void *OpenDirectory(const char *name);
44 virtual void FreeDirectory(void *dirp);
45 virtual const char *GetDirEntry(void *dirp);
46 virtual void *GetDirPtr() const { return 0; }
47 virtual Bool_t ChangeDirectory(const char *path);
48 virtual const char *WorkingDirectory();
49 virtual const char *HomeDirectory(const char *userName = 0);
50 virtual int mkdir(const char *name, Bool_t recursive = kFALSE);
51 Bool_t cd(const char *path) { return ChangeDirectory(path); }
52 const char *pwd() { return WorkingDirectory(); }
53
54 //---- Paths & Files
55 virtual int CopyFile(const char *from, const char *to, Bool_t overwrite = kFALSE);
56 virtual int Rename(const char *from, const char *to);
57 virtual int Link(const char *from, const char *to);
58 virtual int Symlink(const char *from, const char *to);
59 virtual int Unlink(const char *name);
60 int GetPathInfo(const char *path, Long_t *id, Long_t *size, Long_t *flags, Long_t *modtime);
61 int GetPathInfo(const char *path, Long_t *id, Long64_t *size, Long_t *flags, Long_t *modtime);
62 virtual int GetPathInfo(const char *path, FileStat_t &buf);
63 virtual int AlienFilestat(const char *fpath, FileStat_t &buf);
64 virtual int GetFsInfo(const char *path, Long_t *id, Long_t *bsize, Long_t *blocks, Long_t *bfree);
65 virtual int Chmod(const char *file, UInt_t mode);
66 virtual int Umask(Int_t mask);
67 virtual int Utime(const char *file, Long_t modtime, Long_t actime);
68 virtual const char *FindFile(const char *search, TString& file, EAccessMode mode = kFileExists);
69 virtual Bool_t AccessPathName(const char *path, EAccessMode mode = kFileExists);
70
71 //---- Users & Groups
72 virtual Int_t GetUid(const char *user = 0);
73 virtual Int_t GetGid(const char *group = 0);
74 virtual Int_t GetEffectiveUid();
75 virtual Int_t GetEffectiveGid();
76 virtual UserGroup_t *GetUserInfo(Int_t uid);
77 virtual UserGroup_t *GetUserInfo(const char *user = 0);
78 virtual UserGroup_t *GetGroupInfo(Int_t gid);
79 virtual UserGroup_t *GetGroupInfo(const char *group = 0);
80
81 ClassDef(TAlienSystem,0) // System interface to the Alien Catalogue
82};
83
84#endif
int Int_t
Definition: RtypesCore.h:41
unsigned int UInt_t
Definition: RtypesCore.h:42
const Bool_t kFALSE
Definition: RtypesCore.h:88
long Long_t
Definition: RtypesCore.h:50
bool Bool_t
Definition: RtypesCore.h:59
long long Long64_t
Definition: RtypesCore.h:69
#define ClassDef(name, id)
Definition: Rtypes.h:326
char name[80]
Definition: TGX11.cxx:109
EAccessMode
Definition: TSystem.h:44
@ kFileExists
Definition: TSystem.h:45
virtual Bool_t Init()
Initialize the OS interface.
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
virtual UserGroup_t * GetGroupInfo(Int_t gid)
Returns all group info in the UserGroup_t structure.
virtual void * OpenDirectory(const char *name)
Open a directory. Returns 0 if directory does not exist.
virtual const char * WorkingDirectory()
Return working directory.
virtual const char * FindFile(const char *search, TString &file, EAccessMode mode=kFileExists)
Find location of file in a search path.
virtual Int_t GetUid(const char *user=0)
Returns the user's id. If user = 0, returns current user's id.
const char * pwd()
Definition: TAlienSystem.h:52
virtual 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.
virtual int Unlink(const char *name)
Unlink, i.e. remove, a file.
char fWorkingDirectory[1024]
Definition: TAlienSystem.h:32
virtual Int_t GetGid(const char *group=0)
Returns the group's id. If group = 0, returns current user's group.
virtual void * GetDirPtr() const
Definition: TAlienSystem.h:46
virtual int Symlink(const char *from, const char *to)
Create a symbolic link from file1 to file2.
virtual const char * GetDirEntry(void *dirp)
Get a directory entry. Returns 0 if no more entries.
virtual int Utime(const char *file, Long_t modtime, Long_t actime)
Set the a files modification and access times.
virtual int Umask(Int_t mask)
Set the process file creation mode mask.
virtual Int_t GetEffectiveUid()
Returns the effective user id.
virtual int mkdir(const char *name, Bool_t recursive=kFALSE)
Make a file system directory.
virtual const char * HomeDirectory(const char *userName=0)
Return the user's home directory.
Bool_t cd(const char *path)
Definition: TAlienSystem.h:51
virtual int Link(const char *from, const char *to)
Create a link from file1 to file2.
virtual void FreeDirectory(void *dirp)
Free a directory.
virtual ~TAlienSystem()
Delete the OS interface.
virtual int MakeDirectory(const char *name)
Make a directory.
virtual int Chmod(const char *file, UInt_t mode)
Set the file permission bits. Returns -1 in case or error, 0 otherwise.
virtual int CopyFile(const char *from, const char *to, Bool_t overwrite=kFALSE)
Copy a file.
TAlienSystem(const char *name="Generic", const char *title="Generic System")
Create a new OS interface.
virtual Int_t GetEffectiveGid()
Returns the effective group id.
virtual int AlienFilestat(const char *fpath, FileStat_t &buf)
Get info about a file.
virtual Bool_t ChangeDirectory(const char *path)
Change directory.
virtual int Rename(const char *from, const char *to)
Rename a file.
int GetPathInfo(const char *path, Long_t *id, Long_t *size, Long_t *flags, Long_t *modtime)
Get info about a file: id, size, flags, modification time.
virtual UserGroup_t * GetUserInfo(Int_t uid)
Returns all user info in the UserGroup_t structure.
Basic string class.
Definition: TString.h:131
Abstract base class defining a generic interface to the underlying Operating System.
Definition: TSystem.h:268
Definition: file.py:1