X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-psi;a=blobdiff_plain;f=psi.d%2Fstat.psi;h=dc89119624d37cc474ee60b3549d440ee74f1472;hp=e5d8eba135b6e22a4052ca4e90c550332db44f84;hb=974c9580535a1668dd6eed9992d582ebcc29b27a;hpb=6bdeeb7b332a272617814a4358d51bb07c872407 diff --git a/psi.d/stat.psi b/psi.d/stat.psi index e5d8eba..dc89119 100644 --- a/psi.d/stat.psi +++ b/psi.d/stat.psi @@ -1,7 +1,7 @@ -extern int stat(char *path, struct stat *buf); +// 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); + let buf = calloc(1, psi\SIZEOF_STRUCT_STAT); return to_int(stat); set $buf = to_array(*buf, to_int(st_dev), @@ -15,31 +15,35 @@ function psi\stat(string $path, array &$buf = NULL) : int { to_array(st_atim, to_int(tv_sec), to_int(tv_nsec) - ), + ), to_array(st_atimespec, to_int(tv_sec), to_int(tv_nsec) ), + to_int(st_atime), to_array(st_mtim, to_int(tv_sec), to_int(tv_nsec) - ), + ), to_array(st_mtimespec, to_int(tv_sec), to_int(tv_nsec) ), + to_int(st_mtime), to_array(st_ctim, to_int(tv_sec), to_int(tv_nsec) - ), + ), to_array(st_ctimespec, to_int(tv_sec), to_int(tv_nsec) ), + to_int(st_ctime), 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),