#include <ace/Dirent.h>
class ACE_Dirent {
public:ACE_Dirent (void);ACE_Dirent (const char *dirname);int open (const char *filename);~ACE_Dirent (void);void close (void);dirent *read (void);int read (struct dirent *entry, struct dirent **result);long tell (void);void seek (long loc);void rewind (void);private:DIR *dirp_;};
ACE_Dirent (void);
ACE_Dirent (const char *dirname);
opendir
int open (const char *filename);
~ACE_Dirent (void);
closedir.
void close (void);
dirent *read (void);
readdir shall not return
directory entries containing empty names. It is unspecified
whether entries are returned for dot or dot-dot. The pointer
returned by readdir points to data that may be overwritten by
another call to readdir on the same directory stream. This
data shall not be overwritten by another call to readdir on a
different directory stream. readdir may buffer several
directory entries per actual read operation; readdir marks for
update the st_atime field of the directory each time the
directory is actually read.
int read (struct dirent *entry, struct dirent **result);
readdir except that an
entry and result buffer must be supplied by the caller to
store the result.
long tell (void);
void seek (long loc);
readdir operation on the
directory stream. The new position reverts to the position
associated with the directory stream at the time the telldir
operation that provides loc was performed. Values returned by
telldir are good only for the lifetime of the DIR pointer from
which they are derived. If the directory is closed and then
reopened, the telldir value may be invalidated due to
undetected directory compaction. It is safe to use a previous
telldir value immediately after a call to opendir and before
any calls to readdir.
void rewind (void);
opendir would.
schmidt@cs.wustl.edu