P_open_dir, P_read_dir, P_close_dir 3porty 2011-05-28 libporty manual

NAME

P_open_dir, P_read_dir, P_close_dir

SYNPOSIS

#include <libporty/host/fs.h>

void * P_open_dir (const char * dirname );
const char * P_read_dir (void * handle );
void P_close_dir (void * handle );

Link with -lporty_host

DESCRIPTION

P_open_dir opens a directory for listing. The same directory may be open multiple times in parallel and each handle returned would reference to full internal states of a query.

The next/first file name or end-of-list marker is returned by P_read_dir called with the handle returned by P_open_dir .

Finally, when the query is not needed anymore, P_close_dir should be called to free up all memory associated with the query.

RETURN VALUE

P_open_dir returns a handle for the query or NULL on error. P_read_dir returns a pointer to the next file name (read-only) or NULL if there are no more files for this query.

P_open_dir, P_read_dir, P_close_dir 3porty 2011-05-28 libporty manual