int AG_MkDir (const char *path)
int AG_MkPath (const char *path)
int AG_RmDir (const char *path)
int AG_ChDir (const char *path)
void AG_GetCWD (char *dst, AG_Size dstLen)
AG_Dir * AG_OpenDir (const char *path)
void AG_CloseDir (AG_Dir *dir)
|
The
AG_MkDir() function creates a new directory under the specified path.
The
AG_MkPath() variant tries to create additional directories if elements of the path are
missing.
Both return 0 on success, -1 on failure.
AG_RmDir() removes the specified directory, assumed to be empty, returning 0 on success
and -1 on failure.
The
AG_ChDir() function changes the working directory to the specified value, returning 0
on success and -1 on failure.
AG_GetCWD() returns the current working directory path into
dst, assumed to be
dstLen bytes in size.
AG_OpenDir() opens the specified directory.
If successful, the function returns a newly allocated
AG_Dir structure:
typedef struct ag_dir {
char **ents; /* Filenames */
int nents;
} AG_Dir;
|
The
ents array contains the filenames for all directory entries.
Regardless of the filesystem's character encoding,
ents is in UTF-8 encoding.
AG_CloseDir() closes the given directory.
|