AP_ROMFS: Enable/fix mavlink ftp ListDirectory for @ROMFS top level #19865
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.
The AP_ROMFS had a dir list method added a while back, but it does not work to show the top level files in the ROMFS. For example, the mavproxy command "ftp list @RomfS" or "ftp list @ROMFS/" doesn't work. The existing code expects a directory name after the backend @ROMFS/ string, e.g @ROMFS/models.
With the suggested change, "ftp list @RomfS" will return a list of all files in the romfs embedded file. The previous behavior is retained as well and "ftp list @ROMFS/models" will only list the files with a name starting with models/ and stripping the directory part.