43 #include <sys/types.h> 59 d = opendir (dir_name);
76 if (e->d_type == DT_DIR
77 && (! strcmp (e->d_name,
".")
78 || ! strcmp (e->d_name,
"..")))
83 if (e->d_type == DT_DIR)
87 s =
format (s,
"%s/%s", dir_name, e->d_name);
88 t =
format (t,
"%s", e->d_name);
89 error = f (arg, s, t);
109 fd = open (file_name, O_WRONLY);
118 if (write (fd, s,
vec_len (s)) < 0)
135 fd = open (file_name, O_RDONLY);
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
#define clib_error_return_unix(e, args...)
clib_error_t * read_sys_fs(char *file_name, char *fmt,...)
#define vec_free(V)
Free vector's memory (no header).
clib_error_t * foreach_directory_file(char *dir_name, clib_error_t *(*f)(void *arg, u8 *path_name, u8 *file_name), void *arg, int scan_dirs)
clib_error_t * write_sys_fs(char *file_name, char *fmt,...)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
#define clib_error_return(e, args...)