Product Site

5.4.8.25. lastAccessed (Attribute)

lastAccessed get:

Returns the last access date of the file or directory denoted by the absolute path of the receiver object. The result is a DateTime object, or .nil if the file or directory doesn't exist or the last access time stamp cannot be retrieved.
lastAccessed set:

If the file or directory denoted by the absolute path of the receiver object exists, this sets the last access date of the file or directory. Otherwise it does nothing.

The date parameter must be a DateTime object.

See also method lastModified (Attribute).

Note

File last access time stamps may not be available on all file systems. Also, on Windows last access time is not updated for NTFS volumes by default.

Example 5.256. File class — lastAccessed attribute
say .File~new(".")~lastAccessed  -- e. g. 2020-02-06T13:03:42.143095