diff --git a/TODO.md b/TODO.md index ebb06e7..b4a3b05 100644 --- a/TODO.md +++ b/TODO.md @@ -355,3 +355,23 @@ lists and no trees, drawing everything from fixed pools by design. A consumer th does allocate would weight ยง4.1's `open`/`read`/`write` far higher than this one does. The next thing worth doing is porting akbasic onto this release and counting the calls again. + +## Requested by consumers + +1. **No directory-reading wrapper.** There is no `aksl_opendir` / `aksl_readdir` / + `aksl_closedir`, so a consumer that wants to list a directory has to call + `opendir(3)` itself and step outside the error convention every other call in + its file follows โ€” reporting through `errno` where everything around it + reports through an `akerr_ErrorContext *`. + + `akbasic` hit this implementing Commodore BASIC's `DIRECTORY` verb, and + refuses the verb rather than working around it: `src/runtime_disk.c` reports + "DIRECTORY is not implemented: libakstdlib has no directory-reading wrapper + yet". The shape it wants is the one the `aksl_f*` family already has โ€” a + handle out through a pointer parameter, `NULL` on success, `ENOENT` and + `EACCES` propagated as themselves. + + A wrapper would want tests for: a directory that does not exist, one that + cannot be searched, an empty one, and one whose entries outlast a single + read โ€” plus whatever the `d_type` portability story turns out to be, since + not every filesystem fills it in.