CalgaryToSpace / CTS-SAT-1-OBC-Firmware

Firmware for the CTS-SAT-1 ("FrontierSat") mission. Runs on the STM32-based Onboard Computer.
MIT License
7 stars 0 forks source link

Telecommand: list files in flash/LittleFS filesystem #7

Open DeflateAwning opened 6 months ago

DeflateAwning commented 6 months ago

Like the Linux du command, this command should list the files in the filesystem, ordered by filename, descending.

In general, the filename will include and/or start with the timestamp.

Arguments:

  1. Offset: skip this many files at the start
  2. Count: get this many files
  3. String contains (optional): a substring that the file path should contain (e.g., filter to only photos, only logs, etc.)
robotoshi commented 3 months ago

@DeflateAwning The GNU du command lists the size of a given file on the disk. Is that what you intended? The description sounds more like a version of ls or find, so I'm a bit confused. Is this intended to print out the equivalent of a File Allocation Table?

DeflateAwning commented 3 months ago

Probably fine to leave out the file sizes for now, unless it's easy to include them

Not too sure what a FAT is, so probably not that. Can you give an example though?

We can tweak it or add more commands if there're operational deficiencies. Just kinda imagine CLI filesystem browsing UX.

I agree, more like find or ls. Recursive listing was the feature of du I really wanted to highlight, but file sizes are probably valuable too.

Was also thinking about how S3 object storage prefixes work as I wrote it. Maybe not that applicable though

Saksham-P commented 3 months ago

The way I am currently thinking of it is basically the ls command, but have the files be sorted by filename, and allow for optional arguments such as the ones Parker mentioned:

  1. Offset: skip this many files at the start
  2. Count: get this many files
  3. String contains (optional): a substring that the file path should contain (e.g., filter to only photos, only logs, etc.)

The size of the file shouldn't be too big of an issue to deal with, but I will take baby steps

DeflateAwning commented 3 months ago

We don't have a mechanism for optional arguments. The "optional" argument must be explicitly specified (e.g., Offset arg will just be 0). Perhaps an empty string can be used to set the string filter argument to "no contains filter".