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 <stdint.h>
7
10struct fsstat_s {
11 uint64_t lmod;
12 uint64_t fsze;
13};
14
21typedef int (*fswalkfn_t)(const char* fp, const struct fsstat_s* st,
22 void* udata);
23
34int fswalk(const char* dir, fswalkfn_t filefn, void* udata);
35
42int fsstat(const char* fp, struct fsstat_s* s);
43
51char* fsjoin(const char* dir, const char* file);
52
53#endif// FSAUTOPROC_FS_H
int fswalk(const char *dir, fswalkfn_t filefn, void *udata)
Recursively walks the single directory described by dir and calls filefn for each file found.
Definition fs.c:36
int(* fswalkfn_t)(const char *fp, const struct fsstat_s *st, void *udata)
Callback function used by fswalk to process files and directories.
Definition fs.h:21
char * fsjoin(const char *dir, const char *file)
Concatenates the two strings into a single path string, joined by a / (path separator) character....
Definition fs.c:75
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:62
Stat structure for storing the last modified time and file size.
Definition fs.h:10
uint64_t fsze
File size in bytes.
Definition fs.h:12
uint64_t lmod
Last modified time in milliseconds since epoch.
Definition fs.h:11