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_get_sizeFind number of entries in a directory.
dir_closeClose a directory.
dir_rewindRewind 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


EXPERIMENTAL FUNCTION: subject to change without notice

unsigned long dir_get_size (KDir dir, unsigned int skip_control, unsigned long *max_width)

Find number of entries in a directory.

Parameters:

Returns: The number of entries in the directory.
Multithreading Level: Unsafe


void dir_close (KDir dir)

Close a directory.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

void dir_rewind (KDir dir)

Rewind a directory.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe


Tables


dir_SKIP_VALUES List of defined skip control 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