mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-19 05:39:17 +02:00
Added Cyc_file_last_modified_time
This commit is contained in:
parent
d72c54ca17
commit
3e9da5e291
2 changed files with 9 additions and 0 deletions
|
@ -529,6 +529,7 @@ void Cyc_halt(object obj);
|
|||
object __halt(object obj);
|
||||
object Cyc_io_delete_file(void *data, object filename);
|
||||
object Cyc_io_file_exists(void *data, object filename);
|
||||
time_t Cyc_file_last_modified_time(char *path);
|
||||
/**@}*/
|
||||
|
||||
/**
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
#include <limits.h>
|
||||
#include <ctype.h>
|
||||
//#include <signal.h> // only used for debugging!
|
||||
#include <sys/stat.h>
|
||||
|
||||
static uint32_t Cyc_utf8_decode(uint32_t* state, uint32_t* codep, uint32_t byte);
|
||||
static int Cyc_utf8_count_code_points_and_bytes(uint8_t* s, char_type *codepoint, int *cpts, int *bytes);
|
||||
|
@ -4321,6 +4322,13 @@ object Cyc_io_file_exists(void *data, object filename)
|
|||
return boolean_f;
|
||||
}
|
||||
|
||||
time_t Cyc_file_last_modified_time(char *path) {
|
||||
struct stat attr;
|
||||
stat(path, &attr);
|
||||
return(attr.st_mtime);
|
||||
}
|
||||
|
||||
|
||||
// Functions internal to the runtime that use malloc
|
||||
list malloc_make_pair(object a, object d)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue