00001 #ifndef __SYS_DIR_H__ 00002 #define __SYS_DIR_H__ 00003 /******************************************************************************/ 00004 /* */ 00005 /* X r d S y s D i r . h h */ 00006 /* */ 00007 /* (c) 2006 G. Ganis (CERN) */ 00008 /* All Rights Reserved. See XrdInfo.cc for complete License Terms */ 00009 /******************************************************************************/ 00010 // $Id: XrdSysDir.hh 22437 2008-03-04 14:35:16Z rdm $ 00011 00012 ////////////////////////////////////////////////////////////////////////// 00013 // // 00014 // XrdSysDir // 00015 // // 00016 // Author: G. Ganis, CERN, 2006 // 00017 // // 00018 // API for handling directories // 00019 // // 00020 ////////////////////////////////////////////////////////////////////////// 00021 00022 #if !defined(WINDOWS) 00023 # include <sys/types.h> 00024 #else 00025 # define uid_t unsigned int 00026 # define gid_t unsigned int 00027 #endif 00028 00029 class XrdSysDir 00030 { 00031 public: 00032 XrdSysDir(const char *path); 00033 virtual ~XrdSysDir(); 00034 00035 bool isValid() { return (dhandle ? 1 : 0); } 00036 int lastError() { return lasterr; } 00037 char *nextEntry(); 00038 00039 private: 00040 void *dhandle; // Directory handle 00041 int lasterr; // Error occured at last operation 00042 }; 00043 #endif