Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Telecommand: list files in flash/LittleFS filesystem #7

Open
DeflateAwning opened this issue Mar 10, 2024 · 5 comments · May be fixed by #216
Open

Telecommand: list files in flash/LittleFS filesystem #7

DeflateAwning opened this issue Mar 10, 2024 · 5 comments · May be fixed by #216
Labels
command Related to implementing a telecommand requirement A mission requirement

Comments

@DeflateAwning
Copy link
Contributor

DeflateAwning commented Mar 10, 2024

Like the Linux du command, this command should list the files in the filesystem, ordered by filename, descending (i.e., latest date first, ideally).

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.)
@DeflateAwning DeflateAwning transferred this issue from CalgaryToSpace/CTS-SAT-1-EPS-Firmware-Dev Mar 10, 2024
@DeflateAwning DeflateAwning added requirement A mission requirement command Related to implementing a telecommand waiting This issue is waiting for other issues to be completed before it can start labels Mar 10, 2024
@DeflateAwning DeflateAwning removed the waiting This issue is waiting for other issues to be completed before it can start label Jun 16, 2024
@DeflateAwning DeflateAwning changed the title Telecommand: list files in flash Telecommand: list files in flash/LittleFS filesystem Jun 16, 2024
@robotoshi
Copy link
Member

@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
Copy link
Contributor Author

DeflateAwning commented Jul 3, 2024

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
Copy link
Contributor

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
Copy link
Contributor Author

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".

@KaleF07 KaleF07 assigned KaleF07 and unassigned KaleF07 Oct 9, 2024
@Saksham-P
Copy link
Contributor

Just as an update

The current progress on this is that I have created list_directory and make_directory telecommands that successfully work, although they only take in 1 argument for now which is the directory name.

  • One thing to note is that currently the list_directory telecommand is currently just using DEBUG statements to print it to the serial, and the function automatically lists the files/directories in alphabetical order (ascending).

I will work towards getting the arguments offset and count working next.

@Saksham-P Saksham-P linked a pull request Oct 20, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
command Related to implementing a telecommand requirement A mission requirement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants