1
2
3
4
5
6 using System.Collections;
7
8 namespace System
9 {
10 public nothrow int Execute(const string& command)
11 {
12 return RtExecute(command.Chars());
13 }
14
15 public nothrow int Execute(const string& command, const List<Pair<int, string>>& redirections)
16 {
17 int execHandle = RtBeginExec(command.Chars());
18 for (const Pair<int, string>& redirection : redirections)
19 {
20 int handle = redirection.first;
21 const string& file = redirection.second;
22 RtAddRedirection(execHandle, handle, file.Chars());
23 }
24 return RtEndExec(execHandle);
25 }
26
27 public nothrow string GetPathToExecutable()
28 {
29 int pathHandle = RtBeginGetPathToExecutable();
30 string pathToExecutable = RtGetPathToExecutable(pathHandle);
31 RtEndGetPathToExecutable(pathHandle);
32 return pathToExecutable;
33 }
34 }