spBase
Loading...
Searching...
No Matches
Directory

Functions

DIR * spOpenDir (const char *path)
 
struct dirent * spReadDir (DIR *dirp)
 
int spCloseDir (DIR *dirp)
 

Detailed Description

Function Documentation

◆ spOpenDir()

DIR * spOpenDir ( const char * path)
extern

Opens the directory specified by path.

Parameters
[in]pathThe path of a directory to open.
Returns
The directory pointer on success, or NULL on failure.
Examples
dirtest.c.

◆ spReadDir()

struct dirent * spReadDir ( DIR * dirp)
extern

Reads data of the directory.

Parameters
[in]dirpThe directory pointer obtained by spOpenDir() .
Returns
The pointer to struct dirent whose members of d_name and d_namlen are the name of the file associated with the pointer and the length of the name respectively. This function normally reads directories of '.' (the current directory) and '..' (the parent directory). NULL will be returned if error occurs or all files have been read.
See also
spOpenDir()
Examples
dirtest.c.

◆ spCloseDir()

int spCloseDir ( DIR * dirp)
extern

Closes the directory.

Parameters
[in]dirpThe directory pointer obtained by spOpenDir() .
Return values
0Success
-1Failure
See also
spOpenDir()
Examples
dirtest.c.