The "dir" Package

These routines are meant to provide an enhanced, portable method for scanning directories and automatically obtaining file status information.

Library: karma
Link With: -lkarma

Functions

dir_openOpen a directory for reading (scanning).
dir_readRead (scan) a directory for files.
dir_closeClose a directory.

Tables

dir_SKIP_VALUESList of defined skip control values


Functions


KDir dir_open (CONST char *dirname)

Open a directory for reading (scanning).

Parameters:

Returns: A KDir object on success, else NULL.
Multithreading Level: Unsafe


KFileInfo * dir_read (KDir dir, unsigned int skip_control)

Read (scan) a directory for files.

Parameters:

Returns: A pointer to a KFileInfo structure on success, else NULL. The data in this structure is valid until the next call to dir_read or dir_close with this directory object.
Multithreading Level: Unsafe


void dir_close (KDir dir)

Close a directory.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe


Tables


dir_SKIP_VALUES

Mode Meaning
KDIR_DOT Pass ".", skip ".."
KDIR_DOTDOT Pass "..", skip "."
KDIR_DOT_AND_DOTDOT Pass "." and ".."
KDIR_NO_DOTS Skip "." and ".."


Back to Karma Home Page
Contact: Richard Gooch
Web Development: Ariel Internet Services