X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-psi;a=blobdiff_plain;f=psi.d%2Fstat.psi;h=3d0e62330efdbd30e0c93c04703e333e7dcde847;hp=17dc18851597e53c0cd5c39e9e3fd2d78f55795f;hb=601e13c0743234c53a62e68fc89f122069123c15;hpb=ea0162a1698563a49de50456cd3f2cc18b83a05e diff --git a/psi.d/stat.psi b/psi.d/stat.psi index 17dc188..3d0e623 100644 --- a/psi.d/stat.psi +++ b/psi.d/stat.psi @@ -1,8 +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, psi\SIZEOF_STRUCT_STAT); + return stat(path, buf) as to_int(stat); set $buf = to_array(*buf, to_int(st_dev), to_int(st_ino), @@ -20,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) @@ -29,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) @@ -38,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),