List subdirectories, and fix root listing, on embedded filesystems - #1263
Open
meeloo wants to merge 1 commit into
Open
List subdirectories, and fix root listing, on embedded filesystems#1263meeloo wants to merge 1 commit into
meeloo wants to merge 1 commit into
Conversation
Two separate reasons a client saw an empty root on a USE_EMBEDDED_FILES build. EmbeddedFiles::FindFirst only ever reported files, so directories were invisible even when they existed and could be navigated into directly. It now walks the directory list first and reports immediate children with isDirectory set, then the files. It also disagreed with its own caller about how to spell the root. MassStorage::DirectoryExists truncates a trailing separator before delegating, so the root arrives as "", while MassStorage::FindFirst passes the path through untouched, so the same request arrives as "/". The empty-root test matched only the first spelling, and "/" matched no directory entry either, so the listing came back empty rather than failing - which is why it looked like "there is nothing there" instead of "the lookup is wrong". FindFirst now normalises the trailing separator itself. Duet3_MB6HC is unchanged in size (text 998468); this code is only compiled for embedded-filesystem builds.
|
All contributors have signed the CLA ✍️ ✅ |
Author
|
I have read the Duet3D CLA v2.0 and I hereby sign it |
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.
Two separate reasons a client saw an empty root on a
USE_EMBEDDED_FILESbuild.EmbeddedFiles::FindFirstonly ever reported files, so directories were invisible even when they existed and could be navigated into directly. It now walks the directory list first and reports immediate children withisDirectoryset, then the files.It also disagreed with its own caller about how to spell the root.
MassStorage::DirectoryExiststruncates a trailing separator before delegating, so the root arrives as"", whileMassStorage::FindFirstpasses the path through untouched, so the same request arrives as"/". The empty-root test matched only the first spelling, and"/"matched no directory entry either, so the listing came back empty rather than failing - which is why it looked like "there is nothing there" instead of "the lookup is wrong".FindFirstnow normalises the trailing separator itself.Duet3_MB6HCis unchanged in size; this code is only compiled for embedded-filesystem builds.Testing note: nothing upstream builds
USE_EMBEDDED_FILES, so this cannot be exercised without a build config for the embedded variant. I have one atmeeloo/RepRapFirmware:build/embedded-mb6hc-configand can open it as a separate PR, fold it into this one, or leave it out - whichever suits