file->modificationTime

file->modificationTime is a member in the file Object group; call it on the receiver shown before the arrow.

Target member

Signature

1file->modificationTime

file->modificationTime is a member in the file Object group; call it on the receiver shown before the arrow.

file->modificationTime is called with member syntax on a receiver value. file->modificationTime touches paths or filesystem data. Resolve paths deliberately and avoid mixing visitor-provided path fragments with trusted server paths without validation.

In web-serving modes, request-targeted application file access cannot escape the configured document_root. That boundary can come from the .ini file, the --docroot flag used by the LaiRu HTTP server or FPM process, or FastCGI values such as DOCUMENT_ROOT and SCRIPT_FILENAME supplied by nginx or Apache. See the web root directory, FastCGI options, and LaiRu FPM pages for the deployment side of that boundary.

Examples

Basic call

1file->modificationTime
The example assumes a trusted path. Validate or resolve any path built from visitor input.

Show metadata for a page file

1[2local(page) = file('/var/www/html/index.lasso')3if(#page->exists) => {4    'Path: ' + #page->path + '\n' +5    'Size: ' + #page->size + '\n' +6    'Modified: ' + #page->modificationTime7}8]
Metadata helpers are normally used after `file(path)` and `exists` confirm the path is meaningful.

Sort files by modification time

1[2local(rows) = array3dir('/var/www/html')->eachFilePath => {4    local(f) = file(#1)5    #rows->insert(map('path'=#f->path, 'modified'=#f->modificationTime))6}7#rows8]
Directory iteration and file metadata methods are often used together for admin screens, caches, and generated indexes.

Related