#include "stock.h" int is_file(char *path) int is_writable_file(char *path) unsigned int filesize(char *path) unsigned int filemode(char *path) int is_dir(char *path) int is_present(char *path) int is_empty(char *path) int is_nfs(char *path) int is_changed(char *path) Tbl * dirfiles ( char *path, int flag );
is_dir uses stat(2) to test path, returns 1 if path is a directory, 0 otherwise.
is_present uses stat(2) to test path, returns 1 if path exists, 0 otherwise.
is_empty uses stat(2) to test path; for a plain file, it returns 1 if path has a size of zero, 0 otherwise. For a directory, it returns 1 if the path contains no files, 0 otherwise.
is_nfs checks to see if a file or directory is nfs mounted, returning 1 if it is, 0 otherwise
is_changed keeps a list of paths and modification times, and returns 1 when a path's modification time has changed, 0 otherwise. It always returns 1 on the first call with an existing path, and returns 0 if a path does not exist.
dirfiles returns a list of contents of a directory path. If flag is 0, all entries are returned; if flag is 1, only files are returned; if flag is 2 only directories are returned. The returned list is sorted into alphabetic order, and the directories "." and ".." are omitted. The returned Tbl list should be freed with freetbl(list, free).