tpws,nfqws: track file size in addition to mod time

This commit is contained in:
bol-van
2025-01-24 12:50:17 +03:00
parent 02c76a4fb6
commit aba1fdeb04
14 changed files with 64 additions and 30 deletions

View File

@@ -314,6 +314,14 @@ time_t file_mod_time(const char *filename)
struct stat st;
return stat(filename, &st) == -1 ? 0 : st.st_mtime;
}
bool file_mod_signature(const char *filename, file_mod_sig *ms)
{
struct stat st;
if (stat(filename,&st)==-1) return false;
ms->mod_time=st.st_mtime;
ms->size=st.st_size;
return true;
}
bool pf_in_range(uint16_t port, const port_filter *pf)
{