FILE::STAT 1g 2023-12-12 laplante@plcb.ca GOWEB/FILE


title: “file::stat Function” date: 2023-12-12 author: “laplante@plcb.ca” version: “1.0.0” section: “1g”

category: “GOWEB/FILE”

FILE::STAT

Name

file::stat — Return detailed information about a file.

Synopsis

file::stat or stat(file, [error: variable, file…])

Description

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);

Parameters

Examples

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
}

Author

laplante@plcb.ca

See also

Version