X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-psi;a=blobdiff_plain;f=psi.d%2Fstat.psi;h=68f67814df9d0f954874e148d8bec5c013fd7c7f;hp=82d624976162301b1687dd8d90c5183209aa4232;hb=c0873cbbe9e5a83305adbc2bbd94aede5437f33d;hpb=b4508f6b917660970f887894a6aaed6c220a2c72 diff --git a/psi.d/stat.psi b/psi.d/stat.psi index 82d6249..68f6781 100644 --- a/psi.d/stat.psi +++ b/psi.d/stat.psi @@ -1,7 +1,9 @@ +#include +// extern int stat(char *path, struct stat *buf); function psi\stat(string $path, array &$buf = NULL) : int { let path = strval($path); - let buf = calloc(1, struct stat); - return to_int(stat); + let buf = calloc(1, sizeof(struct stat)); + return stat(path, buf) as to_int(stat); set $buf = to_array(*buf, to_int(st_dev), to_int(st_ino), @@ -19,7 +21,6 @@ function psi\stat(string $path, array &$buf = NULL) : int { to_int(tv_sec), to_int(tv_nsec) ), - to_int(st_atime), to_array(st_mtim, to_int(tv_sec), to_int(tv_nsec) @@ -28,7 +29,6 @@ function psi\stat(string $path, array &$buf = NULL) : int { to_int(tv_sec), to_int(tv_nsec) ), - to_int(st_mtime), to_array(st_ctim, to_int(tv_sec), to_int(tv_nsec) @@ -37,12 +37,14 @@ function psi\stat(string $path, array &$buf = NULL) : int { to_int(tv_sec), to_int(tv_nsec) ), - to_int(st_ctime), + to_array(st_birthtim, + to_int(tv_sec), + to_int(tv_nsec) + ), to_array(st_birthtimespec, to_int(tv_sec), to_int(tv_nsec) ), - to_int(st_birthtime), to_int(st_blksize), to_int(st_blocks), to_int(st_flags),