timeLastModified

Returns the time that the given file was last modified.

  1. SysTime timeLastModified(R name)
    SysTime
    timeLastModified
    (
    R
    )
    ()
    if (
    isSomeFiniteCharInputRange!R &&
    !isConvertibleToString!R
    )
  2. SysTime timeLastModified(R name)
  3. SysTime timeLastModified(R name, SysTime returnIfMissing)
  4. SysTime timeLastModified(stat_t statbuf)

Parameters

name R

the name of the file to check

Return Value

Type: SysTime

Throws

FileException if the given file does not exist.

Examples

import std.datetime : abs, DateTime, hnsecs, SysTime;
scope(exit) deleteme.remove;

import std.datetime : Clock, seconds;
auto currTime = Clock.currTime();
enum leeway = 5.seconds;
deleteme.write("bb");
assert(abs(deleteme.timeLastModified - currTime) <= leeway);
Suggestion Box / Bug Report