1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310
|
<Type Name="Process" FullName="GLib.Process">
<TypeSignature Language="C#" Value="public class Process" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit Process extends System.Object" />
<AssemblyInfo>
<AssemblyName>glib-sharp</AssemblyName>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Object</BaseTypeName>
</Base>
<Interfaces />
<Docs>
<summary>Process class.</summary>
<remarks>Methods for spawning child processes.</remarks>
</Docs>
<Members>
<Member MemberName="Close">
<MemberSignature Language="C#" Value="public void Close ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void Close() cil managed" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Closes a process.</summary>
<remarks>Processes spawned with <see cref="M:GLib.SpawnFlags.DoNotReapChild" /> must use this method to ensure zombie processes are not stranded.</remarks>
</Docs>
</Member>
<Member MemberName="IgnorePipe">
<MemberSignature Language="C#" Value="public const int IgnorePipe = 2147483647;" />
<MemberSignature Language="ILAsm" Value=".field public static literal int32 IgnorePipe = (2147483647)" />
<MemberType>Field</MemberType>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<MemberValue>2147483647</MemberValue>
<Docs>
<summary>IgnorePipe field.</summary>
<remarks>Pass this value to <see cref="M:GLib.Process.SpawnAsyncWithPipes" /> to ignore a pipe parameter.</remarks>
</Docs>
</Member>
<Member MemberName="RequestPipe">
<MemberSignature Language="C#" Value="public const int RequestPipe = 0;" />
<MemberSignature Language="ILAsm" Value=".field public static literal int32 RequestPipe = (0)" />
<MemberType>Field</MemberType>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<MemberValue>0</MemberValue>
<Docs>
<summary>RequestPipe field.</summary>
<remarks>Pass this value to <see cref="M:GLib.Process.SpawnAsyncWithPipes" /> to request a request a pipe descriptor be returned in the parameter.</remarks>
</Docs>
</Member>
<Member MemberName="SpawnAsync">
<MemberSignature Language="C#" Value="public static bool SpawnAsync (string working_directory, string[] argv, string[] envp, GLib.SpawnFlags flags, GLib.SpawnChildSetupFunc child_setup, out GLib.Process child_process);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig bool SpawnAsync(string working_directory, string[] argv, string[] envp, valuetype GLib.SpawnFlags flags, class GLib.SpawnChildSetupFunc child_setup, class GLib.Process child_process) cil managed" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="working_directory" Type="System.String" />
<Parameter Name="argv" Type="System.String[]" />
<Parameter Name="envp" Type="System.String[]" />
<Parameter Name="flags" Type="GLib.SpawnFlags" />
<Parameter Name="child_setup" Type="GLib.SpawnChildSetupFunc" />
<Parameter Name="child_process" Type="GLib.Process&" RefType="out" />
</Parameters>
<Docs>
<param name="working_directory">The directory in which to execute the process, or <see langword="null" /> to use the current directory of the parent process.</param>
<param name="argv">A string array containing the program name in the first element.</param>
<param name="envp">An array of environment values in the form 'var=value', or <see langword="null" />.</param>
<param name="flags">Process spawning configuration flags.</param>
<param name="child_setup">A child process setup callback, or <see langword="null" />.</param>
<param name="child_process">Returns the child process.</param>
<summary>Spawns a child process asynchronously.</summary>
<returns>A boolean value indicating spawning success.</returns>
<remarks>
<para>The method does not wait for the child process to complete before returning. This is a convenience method for the more detailed <see cref="M:GLib.Process.SpawnAsyncWithPipes" /> method. This method throws <see cref="T:GLib.GException" /> if an error occurs creating the process.</para>
<para>
<example>
<code lang="C#">
...
try {
GLib.Process proc;
GLib.Process.SpawnAsync (null, new string[] {"echo", "[Async echo is running]"}, null, GLib.SpawnFlags.SearchPath, null, out proc);
} catch (GException e) {
Console.WriteLine ("Exception in Spawn operation: " + e);
}
...
</code>
</example>
</para>
</remarks>
</Docs>
</Member>
<Member MemberName="SpawnAsyncWithPipes">
<MemberSignature Language="C#" Value="public static bool SpawnAsyncWithPipes (string working_directory, string[] argv, string[] envp, GLib.SpawnFlags flags, GLib.SpawnChildSetupFunc child_setup, out GLib.Process child_process, ref int stdin, ref int stdout, ref int stderr);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig bool SpawnAsyncWithPipes(string working_directory, string[] argv, string[] envp, valuetype GLib.SpawnFlags flags, class GLib.SpawnChildSetupFunc child_setup, class GLib.Process child_process, int32 stdin, int32 stdout, int32 stderr) cil managed" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="working_directory" Type="System.String" />
<Parameter Name="argv" Type="System.String[]" />
<Parameter Name="envp" Type="System.String[]" />
<Parameter Name="flags" Type="GLib.SpawnFlags" />
<Parameter Name="child_setup" Type="GLib.SpawnChildSetupFunc" />
<Parameter Name="child_process" Type="GLib.Process&" RefType="out" />
<Parameter Name="stdin" Type="System.Int32&" RefType="ref" />
<Parameter Name="stdout" Type="System.Int32&" RefType="ref" />
<Parameter Name="stderr" Type="System.Int32&" RefType="ref" />
</Parameters>
<Docs>
<param name="working_directory">The directory in which to execute the process, or <see langword="null" /> to use the current directory of the parent process.</param>
<param name="argv">A string array containing the program name in the first element.</param>
<param name="envp">An array of environment values in the form 'var=value', or <see langword="null" />.</param>
<param name="flags">Process spawning configuration flags.</param>
<param name="child_setup">A child process setup callback, or <see langword="null" />.</param>
<param name="child_process">Returns the spawned process.</param>
<param name="stdin">Returns the stdin pipe descriptor if caller passes anything but <see cref="GLib.Process.IgnorePipe" />.</param>
<param name="stdout">Returns the stdout pipe descriptor if caller passes anything but <see cref="GLib.Process.IgnorePipe" />.</param>
<param name="stderr">Returns the stderr pipe descriptor if caller passes anything but <see cref="GLib.Process.IgnorePipe" />.</param>
<summary>Spawns a child process and returns requested pipe descriptors.</summary>
<returns>A boolean value indicating operation success.</returns>
<remarks>
<para>This method throws <see cref="T:GLib.GException" /> if an error occurs creating the process.</para>
<para>
<example>
<code lang="C#">
using GLib;
using System;
public class SpawnTest {
public static void Main (string[] args)
{
new SpawnTest ();
}
MainLoop main_loop;
IOChannel channel;
public SpawnTest ()
{
main_loop = new MainLoop ();
try {
Process proc;
int stdin = Process.IgnorePipe;
int stdout = Process.RequestPipe;
int stderr = Process.IgnorePipe;
GLib.Process.SpawnAsyncWithPipes (null, new string[] {"pwd"}, null, SpawnFlags.SearchPath, null, out proc, ref stdin, ref stdout, ref stderr);
channel = new IOChannel (stdout);
channel.AddWatch (0, IOCondition.In | IOCondition.Hup, new IOFunc (ReadStdout));
} catch (Exception e) {
Console.WriteLine ("Exception in Spawn: " + e);
}
main_loop.Run ();
}
bool ReadStdout (IOChannel source, IOCondition condition)
{
if ((condition & IOCondition.In) == IOCondition.In) {
string txt;
if (source.ReadToEnd (out txt) == IOStatus.Normal)
Console.WriteLine ("[SpawnTest output] " + txt);
}
if ((condition & IOCondition.Hup) == IOCondition.Hup) {
source.Dispose ();
main_loop.Quit ();
return true;
}
return true;
}
}
</code>
</example>
</para>
</remarks>
</Docs>
</Member>
<Member MemberName="SpawnCommandLineAsync">
<MemberSignature Language="C#" Value="public static bool SpawnCommandLineAsync (string command_line);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig bool SpawnCommandLineAsync(string command_line) cil managed" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="command_line" Type="System.String" />
</Parameters>
<Docs>
<param name="command_line">The command line with arguments.</param>
<summary>Spawns a child process asynchronously.</summary>
<returns>A boolean value indicating spawning success.</returns>
<remarks />
<remarks>
<para>This method does not wait for the child process to complete before returning. It is a convenience method for the more detailed <see cref="M:GLib.Process.SpawnAsync" /> method.</para>
<para>
<example>
<code lang="C#">
...
try {
GLib.Process.SpawnCommandLineAsync ("echo \"[Async echo process running]\"");
} catch (GException e) {
Console.WriteLine ("Exception in Spawn operation: " + e);
}
...
</code>
</example>
</para>
</remarks>
</Docs>
</Member>
<Member MemberName="SpawnCommandLineSync">
<MemberSignature Language="C#" Value="public static bool SpawnCommandLineSync (string command_line, out string stdout, out string stderr, out int exit_status);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig bool SpawnCommandLineSync(string command_line, string stdout, string stderr, int32 exit_status) cil managed" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="command_line" Type="System.String" />
<Parameter Name="stdout" Type="System.String&" RefType="out" />
<Parameter Name="stderr" Type="System.String&" RefType="out" />
<Parameter Name="exit_status" Type="System.Int32&" RefType="out" />
</Parameters>
<Docs>
<param name="command_line">The command line with arguments.</param>
<param name="stdout">Returns the stdout output of the child process as a string.</param>
<param name="stderr">Returns the stderr output of the child process as a string.</param>
<param name="exit_status">Returns the exit code returned by the process.</param>
<summary>Spawns a child process synchronously.</summary>
<returns>A boolean value indicating spawning success.</returns>
<remarks>
<para>The method waits for the child process to complete prior to returning. This is a convenience method for the more detailed <see cref="M:GLib.Process.SpawnSync" /> method.</para>
<para>
<example>
<code lang="C#">
...
try {
string stdout, stderr;
int exit_status;
GLib.Process.SpawnCommandLineSync ("pwd", out stdout, out stderr, out exit_status);
Console.Write ("pwd exit_status=" + exit_status + " output: " + stdout);
} catch (GException e) {
Console.WriteLine ("Exception in Spawn operation: " + e);
}
...
</code>
</example>
</para>
</remarks>
</Docs>
</Member>
<Member MemberName="SpawnSync">
<MemberSignature Language="C#" Value="public static bool SpawnSync (string working_directory, string[] argv, string[] envp, GLib.SpawnFlags flags, GLib.SpawnChildSetupFunc child_setup, out string stdout, out string stderr, out int exit_status);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig bool SpawnSync(string working_directory, string[] argv, string[] envp, valuetype GLib.SpawnFlags flags, class GLib.SpawnChildSetupFunc child_setup, string stdout, string stderr, int32 exit_status) cil managed" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="working_directory" Type="System.String" />
<Parameter Name="argv" Type="System.String[]" />
<Parameter Name="envp" Type="System.String[]" />
<Parameter Name="flags" Type="GLib.SpawnFlags" />
<Parameter Name="child_setup" Type="GLib.SpawnChildSetupFunc" />
<Parameter Name="stdout" Type="System.String&" RefType="out" />
<Parameter Name="stderr" Type="System.String&" RefType="out" />
<Parameter Name="exit_status" Type="System.Int32&" RefType="out" />
</Parameters>
<Docs>
<param name="working_directory">The directory in which to execute the process, or <see langword="null" /> to use the current directory of the parent process.</param>
<param name="argv">A string array containing the program name in the first element.</param>
<param name="envp">An array of environment values in the form 'var=value', or <see langword="null" />.</param>
<param name="flags">Process spawning configuration flags.</param>
<param name="child_setup">A child process setup callback, or <see langword="null" />.</param>
<param name="stdout">Returns the stdout output of the child process as a string.</param>
<param name="stderr">Returns the stderr output of the child process as a string.</param>
<param name="exit_status">Returns the exit code of the child process.</param>
<summary>Spawns a child process synchronously.</summary>
<returns>A boolean value indicating spawning success.</returns>
<remarks>
<para>The method waits for the child process to complete prior to returning.</para>
<para>
<example>
<code lang="C#">
...
try {
string stdout, stderr;
int exit_status;
GLib.Process.SpawnSync ("/usr", new string[] {"pwd"}, null, GLib.SpawnFlags.SearchPath, null, out stdout, out stderr, out exit_status);
Console.Write ("pwd exit_status=" + exit_status + " output: " + stdout);
} catch (GException e) {
Console.WriteLine ("Exception in Spawn operation: " + e);
}
...
</code>
</example>
</para>
</remarks>
</Docs>
</Member>
</Members>
</Type>
|