#include "shell.hpp" // list all known replicas on a logical file void shell::c_log_list (std::string args) { // sanity checks if ( ! cwd_.exists (args) ) { carp ("No such logical file: " + args); return; } if ( cwd_.is_dir (args) ) { carp ("Cannot list replicas of directory: " + args); return; } // open the current directory as logical dir saga::logical_file::logical_directory dir (cwd_.get_url ()); // open the logical file saga::logical_file::logical_file lf = dir.open (args, saga::logical_file::Read); std::vector list = lf.list_locations (); std::cout << std::endl; // iterate over replica locations for ( std::size_t i = 0; i < list.size (); ++i ) { std::cout << " " << list[i].get_string () << std::endl; } std::cout << std::endl; return; }