File.stat

You're seeing just the function stat, go back to File module for more information.

Specs

stat(Path.t(), stat_options()) :: {:ok, File.Stat.t()} | {:error, posix()}

Returns information about the path. If it exists, it returns a {:ok, info} tuple, where info is a File.Stat struct. Returns {:error, reason} with the same reasons as read/1 if a failure occurs.

Options

The accepted options are:

  • :time - configures how the file timestamps are returned

The values for :time can be:

  • :universal - returns a {date, time} tuple in UTC (default)
  • :local - returns a {date, time} tuple using the same time zone as the machine
  • :posix - returns the time as integer seconds since epoch

Note: Since file times are stored in POSIX time format on most operating systems, it is faster to retrieve file information with the time: :posix option.