Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 178 lines (174 sloc) 11.034 kb
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link rel="stylesheet" href="style.css" type="text/css">
<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
<link rel="Start" href="index.html">
<link rel="previous" href="OpamPath.html">
<link rel="next" href="OpamRepository.html">
<link rel="Up" href="index.html">
<link title="Index of types" rel=Appendix href="index_types.html">
<link title="Index of exceptions" rel=Appendix href="index_exceptions.html">
<link title="Index of values" rel=Appendix href="index_values.html">
<link title="Index of modules" rel=Appendix href="index_modules.html">
<link title="Index of module types" rel=Appendix href="index_module_types.html">
<link title="OpamAlias" rel="Chapter" href="OpamAlias.html">
<link title="OpamClient" rel="Chapter" href="OpamClient.html">
<link title="OpamCompiler" rel="Chapter" href="OpamCompiler.html">
<link title="OpamFile" rel="Chapter" href="OpamFile.html">
<link title="OpamFilename" rel="Chapter" href="OpamFilename.html">
<link title="OpamFormat" rel="Chapter" href="OpamFormat.html">
<link title="OpamFormula" rel="Chapter" href="OpamFormula.html">
<link title="OpamMisc" rel="Chapter" href="OpamMisc.html">
<link title="OpamPackage" rel="Chapter" href="OpamPackage.html">
<link title="OpamParallel" rel="Chapter" href="OpamParallel.html">
<link title="OpamPath" rel="Chapter" href="OpamPath.html">
<link title="OpamProcess" rel="Chapter" href="OpamProcess.html">
<link title="OpamRepository" rel="Chapter" href="OpamRepository.html">
<link title="OpamSolver" rel="Chapter" href="OpamSolver.html">
<link title="OpamSystem" rel="Chapter" href="OpamSystem.html">
<link title="OpamTypes" rel="Chapter" href="OpamTypes.html">
<link title="OpamVariable" rel="Chapter" href="OpamVariable.html">
<link title="OpamVersion" rel="Chapter" href="OpamVersion.html"><title>OpamProcess</title>
</head>
<body>
<div class="navbar"><a href="OpamPath.html">Previous</a>
&nbsp;<a href="index.html">Up</a>
&nbsp;<a href="OpamRepository.html">Next</a>
</div>
<center><h1>Module <a href="type_OpamProcess.html">OpamProcess</a></h1></center>
<br>
<pre><span class="keyword">module</span> OpamProcess: <code class="code">sig</code> <a href="OpamProcess.html">..</a> <code class="code">end</code></pre>Process handling<br>
<hr width="100%">
<br><code><span id="TYPEt"><span class="keyword">type</span> <code class="type"></code>t</span> = {</code><table class="typetable">
<tr>
<td align="left" valign="top" >
<code>&nbsp;&nbsp;</code></td>
<td align="left" valign="top" >
<code>p_name&nbsp;: <code class="type">string</code>;</code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >Command name</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code>&nbsp;&nbsp;</code></td>
<td align="left" valign="top" >
<code>p_args&nbsp;: <code class="type">string list</code>;</code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >Command args</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code>&nbsp;&nbsp;</code></td>
<td align="left" valign="top" >
<code>p_pid&nbsp;: <code class="type">int</code>;</code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >Process PID</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code>&nbsp;&nbsp;</code></td>
<td align="left" valign="top" >
<code>p_time&nbsp;: <code class="type">float</code>;</code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >Process start time</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code>&nbsp;&nbsp;</code></td>
<td align="left" valign="top" >
<code>p_stdout&nbsp;: <code class="type">string option</code>;</code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >stdout dump file</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code>&nbsp;&nbsp;</code></td>
<td align="left" valign="top" >
<code>p_stderr&nbsp;: <code class="type">string option</code>;</code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >stderr dump file</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code>&nbsp;&nbsp;</code></td>
<td align="left" valign="top" >
<code>p_info&nbsp;: <code class="type">string option</code>;</code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >dump info file</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr></table>
}

<div class="info">
The type for processes<br>
</div>

<pre><span id="VALcreate"><span class="keyword">val</span> create</span> : <code class="type">?info:string -><br> ?stdout:string -><br> ?stderr:string -><br> ?env:string array -> verbose:bool -> string -> string list -> <a href="OpamProcess.html#TYPEt">t</a></code></pre><div class="info">
<code class="code">create cmd args</code> create a new process to execute the command
    <code class="code">cmd</code> with arguments <code class="code">args</code>. If stdout/stderr are set, the
    channels are redirected to files. The current environment can also
    be overriden if <code class="code">env</code> is set.<br>
</div>
<br><code><span id="TYPEresult"><span class="keyword">type</span> <code class="type"></code>result</span> = {</code><table class="typetable">
<tr>
<td align="left" valign="top" >
<code>&nbsp;&nbsp;</code></td>
<td align="left" valign="top" >
<code>r_proc&nbsp;: <code class="type"><a href="OpamProcess.html#TYPEt">t</a></code>;</code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >Process</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code>&nbsp;&nbsp;</code></td>
<td align="left" valign="top" >
<code>r_code&nbsp;: <code class="type">int</code>;</code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >Process exit code</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code>&nbsp;&nbsp;</code></td>
<td align="left" valign="top" >
<code>r_duration&nbsp;: <code class="type">float</code>;</code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >Process duration</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code>&nbsp;&nbsp;</code></td>
<td align="left" valign="top" >
<code>r_info&nbsp;: <code class="type">string list</code>;</code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >Environment variables</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code>&nbsp;&nbsp;</code></td>
<td align="left" valign="top" >
<code>r_stdout&nbsp;: <code class="type">string list</code>;</code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >Content of stdout dump file</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code>&nbsp;&nbsp;</code></td>
<td align="left" valign="top" >
<code>r_stderr&nbsp;: <code class="type">string list</code>;</code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >Content of stderr dump file</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr></table>
}

<div class="info">
The type for result processes<br>
</div>

<pre><span id="VALwait"><span class="keyword">val</span> wait</span> : <code class="type"><a href="OpamProcess.html#TYPEt">t</a> -> <a href="OpamProcess.html#TYPEresult">result</a></code></pre><div class="info">
<code class="code">wait p</code> waits for the processus <code class="code">p</code> to end and returns its results.<br>
<b>Raises</b> <code>Global.Exit</code> as only possible error<br>
</div>
<pre><span id="VALrun"><span class="keyword">val</span> run</span> : <code class="type">?env:string array -><br> verbose:bool -> name:string -> string -> string list -> <a href="OpamProcess.html#TYPEresult">result</a></code></pre><div class="info">
<code class="code">run ~name cmd args</code> synchronously call the command <code class="code">cmd</code> with
    arguments <code class="code">args</code>. It waits until the process is finished. The file
    <code class="code">name.out</code>, <code class="code">name.err</code> and <code class="code">name.info</code> are created, which contains
    the standard output, the standart error and some process info
    respectively.<br>
<b>Raises</b> <code>Global.Exit</code> as only possible error<br>
</div>
<pre><span id="VALis_success"><span class="keyword">val</span> is_success</span> : <code class="type"><a href="OpamProcess.html#TYPEresult">result</a> -> bool</code></pre><div class="info">
Is the process result a success ?<br>
</div>
<pre><span id="VALis_failure"><span class="keyword">val</span> is_failure</span> : <code class="type"><a href="OpamProcess.html#TYPEresult">result</a> -> bool</code></pre><div class="info">
Is the process result a failure ?<br>
</div>
<pre><span id="VALclean_files"><span class="keyword">val</span> clean_files</span> : <code class="type"><a href="OpamProcess.html#TYPEresult">result</a> -> unit</code></pre><div class="info">
Clean-up process result files<br>
</div>
<pre><span id="VALread_lines"><span class="keyword">val</span> read_lines</span> : <code class="type">string -> string list</code></pre><div class="info">
<span id="2_Misc"><h2>Misc</h2></span><br>
</div>
<pre><span id="VALdisplay_error_message"><span class="keyword">val</span> display_error_message</span> : <code class="type"><a href="OpamProcess.html#TYPEresult">result</a> -> unit</code></pre></body></html>
Something went wrong with that request. Please try again.