Lean 4 (Meta)programming Cookbook

Checking metadata for path🔗

To check metadata for a path, you can use the System.FilePath.metadata function, which can tell you metadata like filetype, size, access time, etc.

def checkFileSize (path : System.FilePath) : IO Unit := do let metadata System.FilePath.metadata path IO.println s!"Size of {path}: {metadata.byteSize} bytes"