PropWare
3.0.0.229
C++ objects and CMake build system for Parallax Propeller
|
Provides directory operations API declarations. More...
Go to the source code of this file.
Classes | |
struct | DIRstruct |
Defines the dirent.h DIR struct. More... | |
struct | dirent |
Defines the dirent.h dirent struct. More... | |
Macros | |
#define | ATTR_READ_ONLY 0x01 |
#define | ATTR_HIDDEN 0x02 |
#define | ATTR_SYSTEM 0x04 |
#define | ATTR_VOLUME_ID 0x08 |
#define | ATTR_DIRECTORY 0x10 |
#define | ATTR_ARCHIVE 0x20 |
Typedefs | |
typedef struct DIRstruct | DIR |
Defines the dirent.h DIR struct. More... | |
Functions | |
DIR * | opendir (const char *path) |
struct dirent * | readdir (DIR *dirp) |
int | closedir (DIR *dirp) |
Provides directory operations API declarations.
Definition in file dirent.h.
struct DIRstruct |
Defines the dirent.h DIR struct.
DIR fields:
Class Members | ||
---|---|---|
uint32_t | currentcluster | |
uint8_t | currententry | |
uint8_t | currentsector | |
uint8_t | flags | |
uint8_t * | scratch |
struct dirent |
Defines the dirent.h dirent struct.
dirent fields:
Class Members | ||
---|---|---|
uint8_t | attr | |
uint8_t | crtdate_0 | |
uint8_t | crtdate_1 | |
uint8_t | crttime_0 | |
uint8_t | crttime_1 | |
uint8_t | crttimetenth | |
char | d_name[13] | |
uint8_t | filesize_0 | |
uint8_t | filesize_1 | |
uint8_t | filesize_2 | |
uint8_t | filesize_3 | |
uint8_t | lstaccdate_h | |
uint8_t | lstaccdate_l | |
uint8_t | name[11] | |
uint8_t | reserved | |
uint8_t | startcluster_0 | |
uint8_t | startcluster_1 | |
uint8_t | startcluster_2 | |
uint8_t | startcluster_3 | |
uint8_t | wrtdate_0 | |
uint8_t | wrtdate_1 | |
uint8_t | wrttime_0 | |
uint8_t | wrttime_1 |
Defines the dirent.h DIR struct.
DIR fields:
int closedir | ( | DIR * | dirp | ) |
Closes a directory.
The closedir() function closes the named directory stream and frees the structure associated with the dirp pointer, returning 0 on success. On failure, -1 is returned and the global variable errno is set to indicate the error.
dirp | Pointer to directory to close. |
Opens a directory.
The opendir() function opens the directory named by dirname, associates a directory stream with it, and returns a pointer to be used to identify the directory stream in subsequent operations. The pointer NULL is returned if dirname cannot be accessed or if it cannot malloc(3) enough memory to hold the whole thing.
path | The directory to be opened. |
Returns pointer to the next directory entry.
The readdir() function returns a pointer to the next directory entry. It returns NULL upon reaching the end of the directory or detecting an invalid seekdir() operation.
Sample code searches a directory for entry "name":
[in,out] | dirp | Pointer to the DIR struct. |