DIRECTORY is unblocked upstream and can now be written #55
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
DIRECTORY(and its aliasCATALOG) has always refused, and the reason was thatlibakstdlibhad noopendir/readdirwrapper — filed there as issue #10, and refused here rather than worked around, perMAINTENANCE.md.That wrapper has landed.
libakstdlibnow publishesaksl_opendir,aksl_readdir,aksl_closedirandaksl_rewinddir, all in the house error convention, andakbasicpins a revision that has them.So the blocker is gone and only the work is left. The dependency bump that brought the wrapper in changed the refusal from naming the missing wrapper to saying plainly that the verb is unwritten (
src/runtime_disk.c:419), because continuing to blamelibakstdlibhad become false.tests/disk_verbs.casserts both halves — that it says "not implemented", and that it does not still namelibakstdlib.docs/09-files-and-disk.md,docs/11-verb-reference.mdanddocs/13-differences.mdsay the same.What closing this needs
Decisions, more than code — which is why the bump did not just write it:
DIRECTORYprints a header line, one line per entry with a block count, and aBLOCKS FREEtrailer. A filesystem has no 254-byte blocks. Either synthesise a block count from the file size, print byte sizes and accept that it is not Commodore-shaped, or something else — but pick deliberately and write it indocs/13-differences.md.DIRECTORY,DIRECTORY "PATTERN", and a drive/unit suffix. Commodore wildcards are*and?, which are not glob semantics.akbasic_TextSink, like every other printing verb, so it tees to stdout and the akgl text layer alike.AKBASIC_ERR_DEVICEwith the errnolibakstdlibpropagated is probably right.What it would touch
src/runtime_disk.c(akbasic_cmd_directory, currently a bare refusal),tests/disk_verbs.c(the refusal assertions above get replaced by real listing assertions against a fixture directory), atests/language/pair if the output is worth pinning byte-for-byte, and the three doc statements plus theMAINTENANCE.mdparagraph that currently records this as unblocked-but-unwritten.Blast radius is small: nothing calls
akbasic_cmd_directorybut the verb table, and no program can depend on the current behaviour except by catching the refusal.