// Copyright (c) 2005-2007 Andre Merzky // // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE file or copy at // http://www.boost.org/LICENSE_1_0.txt) #include int main (int argc, char* argv[]) { try { saga::job::description jd; std::vector args; std::vector env; std::string exe ("saga-file"); args.push_back ("list_dir"); args.push_back ("/"); env.push_back ("SAGA_VERBOSE=0"); jd.set_attribute (saga::job::attributes::description_executable, exe); jd.set_vector_attribute (saga::job::attributes::description_arguments, args); jd.set_vector_attribute (saga::job::attributes::description_environment, env ); jd.set_attribute (saga::job::attributes::description_interactive, saga::attributes::common_true); saga::job::service js ("ssh://localhost"); saga::job::job j = js.create_job (jd); saga::job::istream out = j.get_stdout (); j.run (); while ( out.good () ) { char c; out.read (&c, 1); if ( out.fail () ) break; std::cout << c; } } catch ( saga::exception const & e ) { std::cerr << e.what (); } return 0; }