fix: Special table owns readdir merge and write-redirect paths - #99
Merged
Conversation
Only uniq-sort directories that contribute Special children, and classify write redirects with Special.null?/1 after normalize so > /dev/./null skips the file-size cap. exec/2 still returns a shell result. Co-authored-by: Dave Lucia <davelucianyc@gmail.com>
VFS uniq-sorts bounded list listings, so a list fixture could not show whether Special.merge_children/2 re-sorted an unrelated directory. Co-authored-by: Dave Lucia <davelucianyc@gmail.com>
davydog187
marked this pull request as ready for review
August 22, 2026 00:06
This was referenced Aug 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Leftover nits from #93 / #78 (
JustBash.FS.Special). The special-file table is the right layer; these edges were still using a drive-by sort and a literal/dev/nullmatch.Changes
Special.merge_children/2only uniq-sorts whenchildren(path)is non-empty. OrdinaryFS.readdir/2/lsorder is the backend's again.Special.null?/1afterFS.resolve_path/2, so> /dev/./nullis the same node as> /dev/nulland skipsLimit.check_file_size!.exec/2still returns a shell result.> /dev/null/) stay on the ordinary open path (bash: not a directory).test -f /dev/nullremains true (VFS.Statis still:regular).Out of scope (investigated, not changed)
ln -s /dev/null /linksucceeds;cat /linkisENOENT. Special lookup is on the operand path, not after symlink follow, so the VFS backend sees no node.mv /dev/null /outis still cp-then-rm.rmis:eacces; the failedwithdrops the copied fs, so/outis not left behind. GNUrenamefails without attempting the copy. Same user-visible result, different mechanism.test -f /dev/nullis true. A char-device type is not needed for the two nits above.Related Issues
Fixes #94
Type of Change
Testing
FS.readdir/2of an unrelated dir preserves backend order (stream backend; VFS already sorts bounded lists)merge_children/2only sorts/and/dev> /dev/./nullwith a payload overmax_file_bytesexits 0 and does not raisemix test: 2 doctests, 62 properties, 5493 tests, 0 failures)mix compile --warnings-as-errors,mix format --check-formatted,mix credo,mix dialyzer,mix docs --warnings-as-errorsChecklist
mix formatmix credoand addressed any issues