templeos-info/public/src/Doc/InFile.DD.HTML

49 lines
3.7 KiB
Plaintext
Raw Normal View History

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="generator" content="TempleOS V5.03">
<link rel="stylesheet" href="/style/templeos.css">
<script src="/script/templeos.js"></script>
<style type="text/css">
.cF0{color:#000000;background-color:#ffffff;}
.cF1{color:#0000aa;background-color:#ffffff;}
.cF2{color:#00aa00;background-color:#ffffff;}
.cF3{color:#00aaaa;background-color:#ffffff;}
.cF4{color:#aa0000;background-color:#ffffff;}
.cF5{color:#aa00aa;background-color:#ffffff;}
.cF6{color:#aa5500;background-color:#ffffff;}
.cF7{color:#aaaaaa;background-color:#ffffff;}
.cF8{color:#555555;background-color:#ffffff;}
.cF9{color:#5555ff;background-color:#ffffff;}
.cFA{color:#55ff55;background-color:#ffffff;}
.cFB{color:#55ffff;background-color:#ffffff;}
.cFC{color:#ff5555;background-color:#ffffff;}
.cFD{color:#ff55ff;background-color:#ffffff;}
.cFE{color:#ffff55;background-color:#ffffff;}
.cFF{color:#ffffff;background-color:#ffffff;}
</style>
</head>
<body>
<pre style="font-family:courier;font-size:10pt">
<a name="l1"></a><span class=cF2>InFiles</span><span class=cF0> are used to generate user input to automate operations. The TempleOS
<a name="l2"></a>tour is done with an </span><span class=cF2>InFile</span><span class=cF0>. It reminds me of a Unix pipe because </span><span class=cF2>StdOut</span><span class=cF0> of one
<a name="l3"></a>gets chained into </span><span class=cF2>StdIn</span><span class=cF0> of another.
<a name="l4"></a>
<a name="l5"></a>When an </span><span class=cF2>InFile</span><span class=cF0> runs, a child task is </span><a href="/src/Kernel/KTask.HC#l242"><span class=cF4>Spawn</span></a><span class=cF0>()ed which intercepts real user input
<a name="l6"></a>and generates fake input. InFiles are </span><a href="/src/Doc/HolyC.DD.HTML#l1"><span class=cF4>HolyC</span></a><span class=cF0> programs run by the child whose
<a name="l7"></a>stdout goes to the parent's input buffer. </span><a href="/src/Kernel/Job.HC#l259"><span class=cF4>Msg</span></a><span class=cF0>() can be included in an </span><span class=cF2>InFile</span><span class=cF0> to
<a name="l8"></a>send special keys or mouse cmds to the parent. While an </span><span class=cF2>InFile</span><span class=cF0> is running, the
<a name="l9"></a>normal input gets diverted to the InFile task and can be filtered and sent back
<a name="l10"></a>to the parent task. Unless you are driving functions which prompt for data, you
<a name="l11"></a>can probably use an </span><span class=cF2>#include</span><span class=cF0> file in place of an </span><span class=cF2>InFile</span><span class=cF0>.
<a name="l12"></a>
<a name="l13"></a>See </span><a href="/src/Demo/InFile/InDir.IN#l1"><span class=cF4>::/Demo/InFile/InDir.IN</span></a><span class=cF0>.
<a name="l14"></a>
<a name="l15"></a>Note: </span><a href="/src/Kernel/Job.HC#l482"><span class=cF4>In</span></a><span class=cF0>(&quot;&quot;) can be used if all you need is to send ASCII characters. It
<a name="l16"></a>differs from </span><a href="/src/Kernel/Job.HC#l464"><span class=cF4>InStr</span></a><span class=cF0>(). You'll probably use </span><a href="/src/Kernel/Job.HC#l482"><span class=cF4>In</span></a><span class=cF0>() a lot and not </span><a href="/src/Kernel/Job.HC#l464"><span class=cF4>InStr</span></a><span class=cF0>(). With </span><a href="/src/Kernel/Job.HC#l482"><span class=cF4>In</span></a><span class=cF0>(
<a name="l17"></a>), for example, you can place answers to the prompts for recompiling the </span><span class=cF2>Kernel</span><span class=cF0>
<a name="l18"></a>module during </span><a href="/src/Adam/Opt/Boot/BootHDIns.HC#l18"><span class=cF4>BootHDIns</span></a><span class=cF0>().
</span></pre></body>
</html>