1 /** 2 * Copyright: Copyright (c) 2009-2011 Jacob Carlborg. All rights reserved. 3 * Authors: Jacob Carlborg 4 * Version: Initial created: Feb 21, 2009 5 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0) 6 */ 7 module dvm.sys.Process; 8 9 import tango.sys.Process; 10 11 /// Copies environment to new process. 12 /// Waits for process to finish. 13 /// Params: 'args' is same as in tango.sys.Process.new(true, char[][] args...) 14 /// Returns: Process.Result (containing status code and reason the process ended) 15 Process.Result system(string[] args...) 16 { 17 Process p; 18 auto result = system(p, args); 19 p.close; 20 return result; 21 } 22 23 /// Has extra param to retreive the Process object used so you can obtain extra information. 24 /// Make sure to call p.close() when you're done with it. 25 Process.Result system(out Process p, string[] args...) 26 { 27 p = new Process(true, args); 28 p.redirect = Redirect.None; 29 p.execute(); 30 auto result = p.wait(); 31 return result; 32 }