title: “file::stat Function” date: 2023-12-12 author: “laplante@plcb.ca” version: “1.0.0” section: “1g”
file::stat — Return detailed information about a file.
file::stat or stat(file, [error: variable, file…])
This function returns detailed information about a file.
The permission value (Perm
) is returned in decimal format.
To display it in octal, use:
printf("%!o(MISSING)", permission);
res={{
stat(file);
}}.
return
res={
"Atime":[^,]+,
"Ctime":[^,]+,
"IsCharDevice":true,
"IsDevice":true,
"IsDir":false,
"IsIrregular":false,
"IsNamedPipe":false,
"IsRegular":false,
"IsSetgid":false,
"IsSetuid":false,
"IsSocket":false,
"IsSticky":false,
"IsSymlink":false,
"Mtime":[^,]+,
"Name":"/dev/null",
"Perm":438,
"Size":0
}
laplante@plcb.ca