fts_children()

create pointer to a linked list files in a directory 

Function


SYNOPSIS

#include <fts.h>

FTSENT *fts_children(FTS *sp, int instr);


DESCRIPTION

The fts_children() function creates and returns a pointer to a linked list of files in the directory represented by the last FTSENT structure returned from fts_read(). If fts_read() has not been called on the hierarchy, then fts_children() returns a pointer to a linked list of files in the logical directory specified to fts_open().


PARAMETERS

sp 

Represents the file hierarchy itself.

instr 

When set to FTS_NAMEONLY, causes all of the fields in the returned FTSENT structure to be undefined except for fts_name and fts_namelen. When set to 0, the entire FTSENT structure is filled in.


RETURN VALUES

The fts_children() function returns a pointer to an FTSENT structure describing the first entry in a NULL terminated linked list of files in the directory, if successful. The fts_children() function may fail and set errno for any of the errors that the chdir(), malloc(), opendir(), readdir(), and stat() functions specify.

EINVAL 

The option list was invalid.

0 

The last FTSENT structure returned by fts_read() is not a directory being visited in pre-order or the directory is empty.


CONFORMANCE

4.4BSD


MULTITHREAD SAFETY LEVEL

Unsafe.


PORTING ISSUES

None.


AVAILABILITY

PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
chdir(), fts_close(), fts_open(), fts_read(), fts_set(), qsort(), stat()


PTC MKS Toolkit 10.4 Documentation Build 39.