PAL file stat metadata
- Type: feature
- Track: B
- Status: done
- Owner: Codex
- Opened: 2026-06-21
- Relation: Follow-up from
feature-sys-getdents; blocks full compact/tile metadata infeature-demo-file-browser.
Problem
SysUtils.GetDirectoryContents can now return entry names and directory flags
from getdents64, but it cannot report file sizes or timestamps. The file
browser therefore renders names and [D] markers only; its compact view cannot
show size/date and preview code cannot cheaply decide file classes from metadata.
Direction
- Add a PAL stat surface, preferably
PalStatAt/PalFStatAtorstatx, with POSIX raw-syscall backing and unsupported stubs for platforms without it. - Expose at least size, mode/type, and modification time in an RTL-friendly record.
- Thread size into
TFileInfo.Sizeinstead of the current-1placeholder.
Acceptance
- A library regression creates a file of known size and a directory, stats both, and verifies size/type through the PAL/SysUtils layer.
examples/fm/fm.pascompact output can show a deterministic file size column.
Log
- 2026-06-21 — Opened while implementing the first file-browser/getdents slice.
- 2026-06-21 — Claimed as part of the resumed PAL slice. Source now exposes
TPalFileStat,PalStat, andPalStatAt; POSIX uses Linuxstatx, ESP returns unsupported with cleared output, andSysUtils.GetDirectoryContentsfills size/type/mtime when metadata is available. - 2026-06-21 — Validation with pinned compiler v32:
tools/library_suite.sh greenandmake lib-testboth pass.test/lib_directory.pasnow checks directory-list file size plus directPalStatfile/dir metadata. - 2026-06-22 — DONE. Commit pending in uncommitted working tree. Regression:
pinned v32
tools/library_suite.sh green,make lib-test, andtools/progress.sh check.