Pike v8.1 release 6

Method file_stat()


Method file_stat

Stdio.Stat file_stat(string path, void|bool symlink)

Description

Stat a file.

If the argument symlink is 1 symlinks will not be followed.

Returns

If the path specified by path doesn't exist 0 (zero) will be returned.

Otherwise an object describing the properties of path will be returned.

Note

In Pike 7.0 and earlier this function returned an array with 7 elements. The old behaviour can be simulated with the following function:

array(int) file_stat(string path, void|int(0..1) symlink)
{
  File.Stat st = predef::file_stat(path, symlink);
  if (!st) return 0;
  return (array(int))st;
}
See also

Stdio.Stat, Stdio.File->stat()