#include "shell.hpp" // open a file, and read chunks of data until we reach EOF, // printing the data found to stdout void shell::c_cat (std::string args) { // sanity checks if ( ! cwd_.exists (args) ) { carp ("No such file: " + args); return; } if ( cwd_.is_dir (args) ) { carp ("Cannot cat directory: " + args); return; } // open the file // FIXME while ( true ) { int const n = 10; saga::uint8_t data[n+1]; for ( int i = 0; i <= n; ++i ) { data[i] = '\0'; } // read a chunk into the buffer if ( 0 // FIXME READ ) { // show what we found std::cout << data; } else { break; } } // file closes when going out of scope return; }