diff --git a/.vscode/settings.json b/.vscode/settings.json index 424486de..ca83696d 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -72,5 +72,6 @@ "editor.rulers": [ 80 ], + "particle.enableVerboseLocalCompilerLogging": true, } \ No newline at end of file diff --git a/src/fileCLI/fileCLI.cpp b/src/fileCLI/fileCLI.cpp index d80579c4..1ab8d34b 100644 --- a/src/fileCLI/fileCLI.cpp +++ b/src/fileCLI/fileCLI.cpp @@ -95,6 +95,7 @@ void FileCLI::list_dir(void) file_stats.st_size, dirent->d_name); } + rewinddir(cwd); } FileCLI::menu_t* FileCLI::findCommand(const char* const cmd) @@ -129,4 +130,23 @@ const char* FileCLI::buildPath(void) path_buffer_idx = strlen(path_buffer); } return path_buffer; +} + +void FileCLI::change_dir(void) +{ + DIR* cwd = this->dir_stack[this->current_dir]; + struct dirent* dirent; + long idx = 0; + + while ((dirent = readdir(cwd))) + { + if(dirent->d_type == DT_REG) + { + continue; + } + idx = telldir(cwd); + SF_OSAL_printf("%d: %-16s" __NL__, + idx, + dirent->d_name); + } } \ No newline at end of file diff --git a/src/fileCLI/fileCLI.hpp b/src/fileCLI/fileCLI.hpp index b7ff2f02..58785d75 100644 --- a/src/fileCLI/fileCLI.hpp +++ b/src/fileCLI/fileCLI.hpp @@ -37,11 +37,6 @@ class FileCLI{ protected: private: - /** - * @brief Switches to the next active file - * - */ - void doNextFile(void); /** * @brief Duplicates the current file * @@ -82,6 +77,11 @@ class FileCLI{ * */ void list_dir(void); + /** + * @brief Changes to the specified directory + * + */ + void change_dir(void); int run = 1; DIR* dir_stack[FILE_CLI_MAX_DIR_DEPTH]; char* path_stack[FILE_CLI_MAX_DIR_DEPTH];