YedPoll - Scan_Dir

NAME:
Scan_Dir

SYNOPSIS:
int Scan_Dir(void *pvObject,SCHAR *pscFilter,SCHAR scFlagType,
             SCHAR scFlagStore);

DESCRIPTION:
The method counts and eventually extracts entries from working directory of pvObject instance.
Entries can be filtered through pscFilter: if NULL, no filter is applied. Format of pscFilter is:

(~)xx\0(~)y\0(~)zzzz\0\0

Any filter substring terminated with '\0' is matched with any directory entry: if an entry contains almost one of them, it's put in the set of filtered entries. The filter must be terminated with sequence '\0\0', else method behaviour is unpredictable. Tilde operator ( '˜' ) applies the inverse rule: if an entry does not contain any filter substring, it's put in the set of filtered entries. If the filter substrings are two or more and there is no tilde operator into them, they're processed in OR mode: if a directory entry has one of them, it's put in the set of filtered entries.

scFlagType parameter selects entry types to examine in the working directory:

POLL_DIR
Scan_Dir examines only subdirectories in working directory ( '.' and '..' included ).

POLL_FILES
Scan_Dir examines only files in working directory.

POLL_ALL
Scan_Dir examines both files and subdirectories in working directory.

scFlagStore parameter sets storing mode of filtered entries. It can be:

YPSTORE
Filtered entries are stored.

YPCOUNT
Filtered entries are only counted, but not stored.

If entries are not stored, invoking some other methods of the object, as Get_Dir_Entries and Get_Size_Dir_Entries, will return an error.

RETURN VALUE:
The method return the number of filtered entries in current working directory. In case of an error, the method returns:

YPNODIR
No working directory is set.

YPNOPENDIR
Error in accessing working directory. Is it non-existent? Or protected?

YPNOMEMORY
Heap memory unavailable to store directory entries.

 


http://yed.sourceforge.net