#include "shell.hpp" // print a list of entries in the curent directory. // resolve symbolic links, and mark directories with / void shell::c_ls (std::string args) { // get the list // FIXME FILL LIST // (the current dir object is a member and called cwd_) std::vector entries; // iterate over children for ( std::size_t i = 0; i < entries.size (); ++i ) { std::cout << " " << entries[i]; // check if child is directory, mark it if ( /* FIXME: check for directory */ 0 ) { std::cout << "/"; } // if child is link, print link target if ( /* FIXME: check for link */ 0 ) { std::cout << " -> " << /* FIXME: get link target */ ""; } std::cout << std::endl; // FIXME: more could be done here, e.g. checking for file // sizes, recursive listings etc. That is left as an // excercise to the reader ;-) } // that it! return; }