pub fn scan_files(dir: &Path) -> Result<Vec<FileInfo>>
Scans a directory for files and returns them sorted by creation time (newest first).
Returns an error if the directory cannot be read.