Capy-Bearer Documentation

file_mtime

host call

Capy

function file_mtime(path : string) u64

Description

file_mtime returns the modification time of a file.

Parameters

path : path of the file to inspect

Return Values

The modification time as a Unix timestamp, or 0 when it is unavailable.

Example

Capy

file_put_contents("/tmp/doc-mtime.txt", "x")
print(file_mtime("/tmp/doc-mtime.txt") > u64(0), "\n")