BOOTSTRAP (kutils) functions
LIBRARY ROUTINE
klist_dirlist - create a linked list of file names
LIBRARY CALL
klist *klist_dirlist(
char *basename,
char *global_dir,
char *filter,
int list_mode,
int format)
INPUT
- basename - base name of the files to be listed.
- global_dir - the global directory is used as a prefix to
basename
- filter - the filter is used in matching the directory
entries. The syntax used is the same as the
"kparse" utilities. If filter is NULL then
all entries are accepted.
- list_mode - a flag indicating what we are to list
(ie. files, directories, dot files, symbolic
links, etc.)
- format - whether the files should be prepended with
type of file. (ie. "@" for sym links, "/" for
directories)
OUTPUT
none
RETURN VALUE
A link list of strings to filenames that match the basename
DESCRIPTION
This module is used to create a linked list of file
names according to a user supplied basename and an
initial global directory. The list mode is used
to indicate what we are going to list in the
directory. The possible defines are listed in
$KHOROS/include/khoros/kdefines.h. The following
symbols are the current list mode:
KPATH - prepend the path to each file
KFILE - list plain text files
KDIR - list directories
KDOT - list dot files
KLINK - list symbolic files
KSOCK - list socket files
KREAD - file is readable by caller
KWRITE - file is writable by caller
KEXEC - file is executable by caller
The selections are or'ed together in order to choose
the set of attributes that are desired. (e.g KFILE | KDIR)
will list only files and directories that match the basename.
ADDITIONAL INFORMATION
none
EXAMPLES
none
SIDE EFFECTS
none
RESTRICTIONS
none
MODIFICATION
none
FILES
$BOOTSTRAP/objects/library/kutils/src/list.c
SEE ALSO
kutils(3)
COPYRIGHT
Copyright (C) 1993 - 1997, Khoral Research, Inc. ("KRI") All rights reserved.