flush
[m6w6/ext-psi] / psi.d / stat.psi
1 function psi\stat(string $path, array &$buf = NULL) : int {
2 let path = strval($path);
3 let buf = calloc(1, struct stat);
4 return to_int(stat);
5 set $buf = to_array(*buf,
6 to_int(st_dev),
7 to_int(st_ino),
8 to_int(st_mode),
9 to_int(st_nlink),
10 to_int(st_uid),
11 to_int(st_gid),
12 to_int(st_rdev),
13 to_int(st_size),
14 to_array(st_atim,
15 to_int(tv_sec),
16 to_int(tv_nsec)
17 ),
18 to_array(st_atimespec,
19 to_int(tv_sec),
20 to_int(tv_nsec)
21 ),
22 to_int(st_atime),
23 to_array(st_mtim,
24 to_int(tv_sec),
25 to_int(tv_nsec)
26 ),
27 to_array(st_mtimespec,
28 to_int(tv_sec),
29 to_int(tv_nsec)
30 ),
31 to_int(st_mtime),
32 to_array(st_ctim,
33 to_int(tv_sec),
34 to_int(tv_nsec)
35 ),
36 to_array(st_ctimespec,
37 to_int(tv_sec),
38 to_int(tv_nsec)
39 ),
40 to_int(st_ctime),
41 to_array(st_birthtimespec,
42 to_int(tv_sec),
43 to_int(tv_nsec)
44 ),
45 to_int(st_birthtime),
46 to_int(st_blksize),
47 to_int(st_blocks),
48 to_int(st_flags),
49 to_int(st_gen)
50 );
51 }