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 /* */ 00009 /* This file is part of the XRootD software suite. */ 00010 /* */ 00011 /* XRootD is free software: you can redistribute it and/or modify it under */ 00012 /* the terms of the GNU Lesser General Public License as published by the */ 00013 /* Free Software Foundation, either version 3 of the License, or (at your */ 00014 /* option) any later version. */ 00015 /* */ 00016 /* XRootD is distributed in the hope that it will be useful, but WITHOUT */ 00017 /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */ 00018 /* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */ 00019 /* License for more details. */ 00020 /* */ 00021 /* You should have received a copy of the GNU Lesser General Public License */ 00022 /* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */ 00023 /* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */ 00024 /* */ 00025 /* The copyright holder's institutional names and contributor's names may not */ 00026 /* be used to endorse or promote products derived from this software without */ 00027 /* specific prior written permission of the institution or contributor. */ 00028 /* All Rights Reserved. See XrdInfo.cc for complete License Terms */ 00029 /******************************************************************************/ 00030 00032 // // 00033 // XrdSysDir // 00034 // // 00035 // Author: G. Ganis, CERN, 2006 // 00036 // // 00037 // API for handling directories // 00038 // // 00040 00041 #if !defined(WINDOWS) 00042 # include <sys/types.h> 00043 #else 00044 # define uid_t unsigned int 00045 # define gid_t unsigned int 00046 #endif 00047 00048 class XrdSysDir 00049 { 00050 public: 00051 XrdSysDir(const char *path); 00052 virtual ~XrdSysDir(); 00053 00054 bool isValid() { return (dhandle ? 1 : 0); } 00055 int lastError() { return lasterr; } 00056 char *nextEntry(); 00057 00058 private: 00059 void *dhandle; // Directory handle 00060 int lasterr; // Error occured at last operation 00061 }; 00062 #endif