begin work on parsing library

This commit is contained in:
Emile Clark-Boman 2025-09-27 13:29:54 +10:00
parent 607cac9b42
commit 76a2390861
2 changed files with 30 additions and 0 deletions

21
parsebin/file.c Normal file
View file

@ -0,0 +1,21 @@
#define _USE_GNU
#include <sys/types.h>
#include <sys/stat.h>
#ifndef WIN32
# include <unistd.h>
#else
# define stat _stat
#endif
// ssize_t abspath(const char *restrict path, char *restrict buf)
int get_mod_time(const char *restrict path, struct timespec *restrict mtime) {
struct stat result;
if(stat(path, &result) == -1)
return ERR;
*mtime = result.st_mtime;
return OK;
}