fsautoproc
Basic file transformation automation management utility
Loading...
Searching...
No Matches
fs.h
Go to the documentation of this file.
1
3#ifndef FSAUTOPROC_FS_H
4#define FSAUTOPROC_FS_H
5
6#include <stdbool.h>
7#include <stdint.h>
8
14typedef int (*fswalkfn_t)(const char* fp, void* udata);
15
29int fswalk(const char* dir, fswalkfn_t filefn, fswalkfn_t dirfn, void* udata);
30
33struct fsstat_s {
34 uint64_t lmod;
35 uint64_t fsze;
36};
37
43bool fsstateql(const struct fsstat_s* a, const struct fsstat_s* b);
44
51int fsstat(const char* fp, struct fsstat_s* s);
52
53#endif// FSAUTOPROC_FS_H
int(* fswalkfn_t)(const char *fp, void *udata)
Callback function used by fswalk to process files and directories.
Definition fs.h:14
bool fsstateql(const struct fsstat_s *a, const struct fsstat_s *b)
fsstateql() compares the fields of two struct fsstat_s values for equality. Two structs with the same...
Definition fs.c:63
int fswalk(const char *dir, fswalkfn_t filefn, fswalkfn_t dirfn, void *udata)
Recursively walks the single directory described by dir and calls filefn for each file found and dirf...
Definition fs.c:24
int fsstat(const char *fp, struct fsstat_s *s)
Populates all fields of a given fsstat_s structure for the file described by the filepath fp.
Definition fs.c:67
Stat structure for storing the last modified time and file size.
Definition fs.h:33
uint64_t fsze
File size in bytes.
Definition fs.h:35
uint64_t lmod
Last modified time in milliseconds since epoch.
Definition fs.h:34