<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://www.computercraft.info/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Hawk777</id>
		<title>ComputerCraft Wiki - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://www.computercraft.info/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Hawk777"/>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/Special:Contributions/Hawk777"/>
		<updated>2026-07-11T07:38:20Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.24.1</generator>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Talk:Coroutine_(API)&amp;diff=5718</id>
		<title>Talk:Coroutine (API)</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Talk:Coroutine_(API)&amp;diff=5718"/>
				<updated>2013-05-28T13:41:22Z</updated>
		
		<summary type="html">&lt;p&gt;Hawk777: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Bottom section (Interaction with other APIs) is written upside-down. It would be more useful to start out talking about how the event-based model ComputerCraft uses actually utilizes coroutines and the .yield and .resume parameters and return values. That is the primary use case for coroutines in ComputerCraft, so it would be better to lead with that, as it will cause less confusion among new users. From there, it would be good to mention that if one does desire to deviate from the event-based model ComputerCraft uses, that one should avoid using (or add special handling for) all of the functions which wait for events. &amp;quot;Blocking&amp;quot; is also a misleading term, since it implies that the execution point gets stuck in that function (which would block other coroutines from running), when the truth of the matter is that it simply yields execution. &amp;quot;Yielding&amp;quot; would be a better term. [[User:Lyqyd|Lyqyd]] 15:53, 28 May 2013 (MSK)&lt;br /&gt;
&lt;br /&gt;
:Better? [[User:Hawk777|Hawk777]] 17:41, 28 May 2013 (MSK)&lt;/div&gt;</summary>
		<author><name>Hawk777</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Coroutine_(API)&amp;diff=5717</id>
		<title>Coroutine (API)</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Coroutine_(API)&amp;diff=5717"/>
				<updated>2013-05-28T13:38:37Z</updated>
		
		<summary type="html">&lt;p&gt;Hawk777: /* Interaction with Other APIs */ Apparently people usually replicate the event dispatcher rather than using asynchronous calls so that should be first&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NeedsWork}}&lt;br /&gt;
:{| border=&amp;quot;1&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| '''Bug'''&lt;br /&gt;
'''From ComputerCraft 1.3''' this API suffers from the problem of potentially spawning Java threads that live forever therefore, use of coroutines should be minimized. This is '''fixed in ComputerCraft 1.32+''', though.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
''This is for the Coroutine API. For the Coroutine Object, visit [[Coroutine (type)]].''&lt;br /&gt;
&lt;br /&gt;
Coroutine is a default Lua 5.1 API defined [http://www.lua.org/manual/5.1/manual.html#5.2 here]. Please list any non-working functions on this page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table style=&amp;quot;width: 100%; border: solid 1px black; margin: 2px; border-spacing: 0px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td colspan=&amp;quot;3&amp;quot; style=&amp;quot;font-weight: bold; font-size: large; padding-bottom: .3em; border-bottom: solid #C9C9C9 1px; background: #D3FFC2; line-height:28px;&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Grid_disk.png|24px]]&amp;amp;nbsp;&amp;amp;nbsp;&lt;br /&gt;
Coroutine (API)&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td style=&amp;quot;width: 100px; background: #E0E0E0; padding: .4em; font-weight:bold;&amp;quot;&amp;gt;Return&amp;lt;/td&amp;gt;&amp;lt;td style=&amp;quot;width: 350px; background: #E0E0E0; padding: .4em; font-weight:bold;&amp;quot;&amp;gt;Method Name&amp;lt;/td&amp;gt;&amp;lt;td style=&amp;quot;background: #E0E0E0; padding: .4em; font-weight:bold;&amp;quot;&amp;gt;Description&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #FFFFFF;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;{{Type|coroutine}} coro&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[coroutine.create]]({{Type|function}} f)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Creates a new coroutine.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #E8E8E8;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;{{Type|boolean}} success, …&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[coroutine.resume]]({{Type|coroutine}} coro, [var1], [var2], ...)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Starts or resumes an existing coroutine.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #FFFFFF;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;{{Type|coroutine}} coro&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[coroutine.running]]()&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Returns the currently executing coroutine.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #E8E8E8;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;{{Type|string}} status&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[coroutine.status]]({{type|coroutine}} coroutine)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Returns the status of the given coroutine.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #FFFFFF;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;{{Type|function}} coroutine wrapper&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[coroutine.wrap]]({{type|function}} function)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Creates a new coroutine and wraps it in a function.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #E8E8E8;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[var3], [var4], …&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[coroutine.yield]]([var1], [var2], …)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Pauses the currently executing coroutine and passes control to its caller.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Coroutine States and Ancestry ==&lt;br /&gt;
Every coroutine is in one of four states:&lt;br /&gt;
* A ''suspended'' coroutine is one that has not yet been started or that has yielded. A suspended coroutine can become running if it is passed to [[coroutine.resume]].&lt;br /&gt;
* A ''running'' coroutine is one that is currently executing code. Only one coroutine can be running at a time on a particular computer. A running coroutine can become suspended if it [[coroutine.yield]], normal if it calls [[coroutine.resume]] on another coroutine, or dead by if it returns from its body function.&lt;br /&gt;
* A ''normal'' coroutine is one that, while running, resumed another coroutine (the ''child coroutine''). A normal coroutine can become running if its child calls [[coroutine.yield]] or returns from its function body.&lt;br /&gt;
* A ''dead'' coroutine is one that, while running, returned from its function body. A dead coroutine can never change state.&lt;br /&gt;
&lt;br /&gt;
While suspended and dead coroutines simply sit loose with no connections to other coroutines, normal and running coroutines have an ancestry relationship between them. Exactly one coroutine is running at any given time, and the running coroutine has no children. Every running or normal coroutine except the top-level BIOS coroutine has a parent, and this relationship forms a chain with one end (the furthest ancestor) being the top-level BIOS coroutine and the other end (the furthest descendant) being the running coroutine. Remember that only the running coroutine can actually execute code, so any functions invoked must be invoked by that coroutine. Then, calling [[coroutine.resume]] makes the chain longer by taking a previously suspended coroutine, hanging it underneath the current coroutine as a new child, and making the current coroutine normal and the new child running. Meanwhile, calling [[coroutine.yield]] makes the chain shorter by turning the currently executing coroutine into a suspended coroutine, detaching it from the chain, and letting its former parent become running.&lt;br /&gt;
&lt;br /&gt;
It is important not to confuse this coroutine chain with the function call stack. Each individual coroutine contains a complete function call stack of its own, rooted at the coroutine’s body function, whether the coroutine is running, normal, or suspended; the chain described in the previous paragraph refers to how entire coroutines are connected together.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
As the coroutine API is very tightly coupled and many of its function must be used to get any interesting results, examples are shown here instead of on the individual function pages.&lt;br /&gt;
&lt;br /&gt;
=== Using the Basic Coroutine Functions ===&lt;br /&gt;
This example demonstrates using the basic coroutine functions to pass control and data between coroutines. This example prints the numbers 1 through 17 in order, showing how control flow moves through the main program coroutine and the two created coroutines, while using assertions to show how data flows through the program:&lt;br /&gt;
&lt;br /&gt;
 -- These variables will hold the coroutine objects.&lt;br /&gt;
 local c1 = nil&lt;br /&gt;
 local c2 = nil&lt;br /&gt;
 &lt;br /&gt;
 -- This function will be the body of the first coroutine.&lt;br /&gt;
 local function f1(x)&lt;br /&gt;
   -- The main code, below, starts c1 first, passing 1.&lt;br /&gt;
   -- Thus c1 should be running, c2 should be suspended (not started yet), and x should receive the value from main, 1.&lt;br /&gt;
   -- STEP 2: Check these assumptions.&lt;br /&gt;
   print(2)&lt;br /&gt;
   assert(coroutine.status(c1) == &amp;quot;running&amp;quot;)&lt;br /&gt;
   assert(coroutine.status(c2) == &amp;quot;suspended&amp;quot;)&lt;br /&gt;
   assert(x == 1)&lt;br /&gt;
   -- STEP 3: Run c2 until it yields, start it off with the value 2.&lt;br /&gt;
   print(3)&lt;br /&gt;
   success, value = coroutine.resume(c2, 2)&lt;br /&gt;
   assert(success)&lt;br /&gt;
   -- In step 6, c2 yields and passes back the value 3.&lt;br /&gt;
   -- Then c2, having yielded, should be suspended, and c1 should be running again.&lt;br /&gt;
   -- STEP 7: Check all that.&lt;br /&gt;
   print(7)&lt;br /&gt;
   assert(coroutine.status(c1) == &amp;quot;running&amp;quot;)&lt;br /&gt;
   assert(coroutine.status(c2) == &amp;quot;suspended&amp;quot;)&lt;br /&gt;
   assert(value == 3)&lt;br /&gt;
   -- STEP 8: Run c2 again, passing it the value 4.&lt;br /&gt;
   -- Since c2 has already run before, this time the 4 will come out of the yield() instead of appear as a function parameter.&lt;br /&gt;
   print(8)&lt;br /&gt;
   success, value = coroutine.resume(c2, 4)&lt;br /&gt;
   -- In step 10, c2 yields and passes back the value 5.&lt;br /&gt;
   -- Then c2, having yielded, should be suspended, and c1 should be running again.&lt;br /&gt;
   -- STEP 11: Check all that.&lt;br /&gt;
   print(11)&lt;br /&gt;
   assert(coroutine.status(c1) == &amp;quot;running&amp;quot;)&lt;br /&gt;
   assert(coroutine.status(c2) == &amp;quot;suspended&amp;quot;)&lt;br /&gt;
   assert(value == 5)&lt;br /&gt;
   -- STEP 12: Yield, turning c1 back into a suspended coroutine and continuing execution of the main program, passing back value 6.&lt;br /&gt;
   print(12)&lt;br /&gt;
   value = coroutine.yield(6)&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 -- This function will be the body of the second coroutine.&lt;br /&gt;
 local function f2(x)&lt;br /&gt;
   -- The first time c2 is run, it is run from f1, which passes 2.&lt;br /&gt;
   -- Thus c1 should be normal (as we are nested inside it), c2 should be running, and x should receive the value from f1, 2.&lt;br /&gt;
   -- STEP 4: Check these assumptions.&lt;br /&gt;
   print(4)&lt;br /&gt;
   assert(coroutine.status(c1) == &amp;quot;normal&amp;quot;)&lt;br /&gt;
   assert(coroutine.status(c2) == &amp;quot;running&amp;quot;)&lt;br /&gt;
   assert(x == 2)&lt;br /&gt;
   -- Because c1 is not suspended, we should not be able to resume it.&lt;br /&gt;
   -- STEP 5: Check this is correct.&lt;br /&gt;
   print(5)&lt;br /&gt;
   success, value = coroutine.resume(c1)&lt;br /&gt;
   assert(not success)&lt;br /&gt;
   assert(value == &amp;quot;cannot resume normal coroutine&amp;quot;)&lt;br /&gt;
   -- STEP 6: Yield, turning c2 back into a suspended coroutine and continuing execution of c1, passing back value 3.&lt;br /&gt;
   print(6)&lt;br /&gt;
   value = coroutine.yield(3)&lt;br /&gt;
   -- In step 8, c1 resumed c2 again and passed the value 4.&lt;br /&gt;
   -- c2 should now be running again, and c1 normal again.&lt;br /&gt;
   -- STEP 9: Check all that.&lt;br /&gt;
   print(9)&lt;br /&gt;
   assert(coroutine.status(c1) == &amp;quot;normal&amp;quot;)&lt;br /&gt;
   assert(coroutine.status(c2) == &amp;quot;running&amp;quot;)&lt;br /&gt;
   assert(value == 4)&lt;br /&gt;
   -- STEP 10: Yield, turning c2 back into a suspended coroutine and continuing execution of c1, passing back value 5.&lt;br /&gt;
   print(10)&lt;br /&gt;
   value = coroutine.yield(5)&lt;br /&gt;
   -- In step 14, the main program resumed c2 directly and passed the value 7, bypassing c1.&lt;br /&gt;
   -- So c2 should be running and c1 should be suspended.&lt;br /&gt;
   -- STEP 15: Check all that.&lt;br /&gt;
   print(15)&lt;br /&gt;
   assert(coroutine.status(c1) == &amp;quot;suspended&amp;quot;)&lt;br /&gt;
   assert(coroutine.status(c2) == &amp;quot;running&amp;quot;)&lt;br /&gt;
   assert(value == 7)&lt;br /&gt;
   -- STEP 16: Now die, returning value 8 to the main program.&lt;br /&gt;
   print(16)&lt;br /&gt;
   return 8&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 -- Construct the two coroutines.&lt;br /&gt;
 c1 = coroutine.create(f1)&lt;br /&gt;
 c2 = coroutine.create(f2)&lt;br /&gt;
 &lt;br /&gt;
 -- Newly constructed coroutines are always suspended.&lt;br /&gt;
 assert(coroutine.status(c1) == &amp;quot;suspended&amp;quot;)&lt;br /&gt;
 assert(coroutine.status(c2) == &amp;quot;suspended&amp;quot;)&lt;br /&gt;
 &lt;br /&gt;
 -- STEP 1: Run c1 until it yields, starting it off with the value 1.&lt;br /&gt;
 print(1)&lt;br /&gt;
 success, value = coroutine.resume(c1, 1)&lt;br /&gt;
 assert(success)&lt;br /&gt;
 &lt;br /&gt;
 -- In step 12, c1 should have yielded and returned the value 6.&lt;br /&gt;
 -- So now c1 and c2 should both be suspended.&lt;br /&gt;
 -- STEP 13: Check all that.&lt;br /&gt;
 print(13)&lt;br /&gt;
 assert(coroutine.status(c1) == &amp;quot;suspended&amp;quot;)&lt;br /&gt;
 assert(coroutine.status(c2) == &amp;quot;suspended&amp;quot;)&lt;br /&gt;
 assert(value == 6)&lt;br /&gt;
 &lt;br /&gt;
 -- STEP 14: Run c2 directly, NOT nested inside c1 this time, passing it the value 7.&lt;br /&gt;
 print(14)&lt;br /&gt;
 success, value = coroutine.resume(c2, 7)&lt;br /&gt;
 assert(success)&lt;br /&gt;
 &lt;br /&gt;
 -- c2 should have exited normally, returning the value 8.&lt;br /&gt;
 -- Therefore c1 should still be suspended, but c2 should be dead.&lt;br /&gt;
 -- STEP 17: Check all that.&lt;br /&gt;
 print(17)&lt;br /&gt;
 assert(coroutine.status(c1) == &amp;quot;suspended&amp;quot;)&lt;br /&gt;
 assert(coroutine.status(c2) == &amp;quot;dead&amp;quot;)&lt;br /&gt;
 assert(value == 8)&lt;br /&gt;
&lt;br /&gt;
=== Using Coroutine Wrapper Functions ===&lt;br /&gt;
This second example is virtually identical, but shows using [[coroutine.wrap]] and wrapper functions instead of the basic coroutine functions (checks of [[coroutine.status]] have been removed as the raw coroutine objects are not available):&lt;br /&gt;
&lt;br /&gt;
 -- These variables will hold the coroutine wrapper functions.&lt;br /&gt;
 local cw1 = nil&lt;br /&gt;
 local cw2 = nil&lt;br /&gt;
 &lt;br /&gt;
 -- This function will be the body of the first coroutine.&lt;br /&gt;
 local function f1(x)&lt;br /&gt;
   -- The main code, below, starts c1 first, passing 1.&lt;br /&gt;
   -- Thus c1 should be running, c2 should be suspended (not started yet), and x should receive the value from main, 1.&lt;br /&gt;
   -- STEP 2: Check these assumptions.&lt;br /&gt;
   print(2)&lt;br /&gt;
   assert(x == 1)&lt;br /&gt;
   -- STEP 3: Run c2 until it yields, start it off with the value 2.&lt;br /&gt;
   print(3)&lt;br /&gt;
   value = cw2(2)&lt;br /&gt;
   -- In step 6, c2 yields and passes back the value 3.&lt;br /&gt;
   -- Then c2, having yielded, should be suspended, and c1 should be running again.&lt;br /&gt;
   -- STEP 7: Check all that.&lt;br /&gt;
   print(7)&lt;br /&gt;
   assert(value == 3)&lt;br /&gt;
   -- STEP 8: Run c2 again, passing it the value 4.&lt;br /&gt;
   -- Since c2 has already run before, this time the 4 will come out of the yield() instead of appear as a function parameter.&lt;br /&gt;
   print(8)&lt;br /&gt;
   value = cw2(4)&lt;br /&gt;
   -- In step 10, c2 yields and passes back the value 5.&lt;br /&gt;
   -- Then c2, having yielded, should be suspended, and c1 should be running again.&lt;br /&gt;
   -- STEP 11: Check all that.&lt;br /&gt;
   print(11)&lt;br /&gt;
   assert(value == 5)&lt;br /&gt;
   -- STEP 12: Yield, turning c1 back into a suspended coroutine and continuing execution of the main program, passing back value 6.&lt;br /&gt;
   print(12)&lt;br /&gt;
   value = coroutine.yield(6)&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 -- This function will be the body of the second coroutine.&lt;br /&gt;
 local function f2(x)&lt;br /&gt;
   -- The first time c2 is run, it is run from f1, which passes 2.&lt;br /&gt;
   -- Thus c1 should be normal (as we are nested inside it), c2 should be running, and x should receive the value from f1, 2.&lt;br /&gt;
   -- STEP 4: Check these assumptions.&lt;br /&gt;
   print(4)&lt;br /&gt;
   assert(x == 2)&lt;br /&gt;
   -- Because c1 is not suspended, we should not be able to resume it.&lt;br /&gt;
   -- STEP 5: Check this is correct (we must use pcall because an error will be raised).&lt;br /&gt;
   print(5)&lt;br /&gt;
   success, value = pcall(cw1)&lt;br /&gt;
   assert(not success)&lt;br /&gt;
   -- STEP 6: Yield, turning c2 back into a suspended coroutine and continuing execution of c1, passing back value 3.&lt;br /&gt;
   print(6)&lt;br /&gt;
   value = coroutine.yield(3)&lt;br /&gt;
   -- In step 8, c1 resumed c2 again and passed the value 4.&lt;br /&gt;
   -- c2 should now be running again, and c1 normal again.&lt;br /&gt;
   -- STEP 9: Check all that.&lt;br /&gt;
   print(9)&lt;br /&gt;
   assert(value == 4)&lt;br /&gt;
   -- STEP 10: Yield, turning c2 back into a suspended coroutine and continuing execution of c1, passing back value 5.&lt;br /&gt;
   print(10)&lt;br /&gt;
   value = coroutine.yield(5)&lt;br /&gt;
   -- In step 14, the main program resumed c2 directly and passed the value 7, bypassing c1.&lt;br /&gt;
   -- So c2 should be running and c1 should be suspended.&lt;br /&gt;
   -- STEP 15: Check all that.&lt;br /&gt;
   print(15)&lt;br /&gt;
   assert(value == 7)&lt;br /&gt;
   -- STEP 16: Now die, returning value 8 to the main program.&lt;br /&gt;
   print(16)&lt;br /&gt;
   return 8&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 -- Construct the two coroutine wrappers.&lt;br /&gt;
 cw1 = coroutine.wrap(f1)&lt;br /&gt;
 cw2 = coroutine.wrap(f2)&lt;br /&gt;
 &lt;br /&gt;
 -- STEP 1: Run cw1 until it yields, starting it off with the value 1.&lt;br /&gt;
 print(1)&lt;br /&gt;
 value = cw1(1)&lt;br /&gt;
 &lt;br /&gt;
 -- In step 12, c1 should have yielded and returned the value 6.&lt;br /&gt;
 -- So now c1 and c2 should both be suspended.&lt;br /&gt;
 -- STEP 13: Check all that.&lt;br /&gt;
 print(13)&lt;br /&gt;
 assert(value == 6)&lt;br /&gt;
 &lt;br /&gt;
 -- STEP 14: Run c2 directly, NOT nested inside c1 this time, passing it the value 7.&lt;br /&gt;
 print(14)&lt;br /&gt;
 value = cw2(7)&lt;br /&gt;
 &lt;br /&gt;
 -- c2 should have exited normally, returning the value 8.&lt;br /&gt;
 -- Therefore c1 should still be suspended, but c2 should be dead.&lt;br /&gt;
 -- STEP 17: Check all that.&lt;br /&gt;
 print(17)&lt;br /&gt;
 assert(value == 8)&lt;br /&gt;
&lt;br /&gt;
== Interaction with Other APIs ==&lt;br /&gt;
The [[OS (API)#pullEvent|os.pullEventRaw]] (and therefore [[os.pullEvent]]) functions are built on top of coroutines: &amp;lt;code&amp;gt;os.pullEventRaw&amp;lt;/code&amp;gt; actually just calls [[coroutine.yield]], passing the event type filter up to the parent coroutine. The parent coroutine is expected to wait until an event of the required type arrives, then use [[coroutine.resume]] to pass the event to the suspended coroutine (where it will be returned from &amp;lt;code&amp;gt;os.pullEventRaw&amp;lt;/code&amp;gt;). If you use the [[Parallel (API)|parallel API]], this is exactly what [[parallel.waitForAny]] and [[parallel.waitForAll]] do: they pull events from the system event queue (or even from a higher invocation of &amp;lt;code&amp;gt;parallel.waitForAny&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;parallel.waitForAll&amp;lt;/code&amp;gt;!) and deliver them to all nested coroutines. Therefore, the easiest way to use coroutines is the parallel API, if it works for your situation. However, in the event that you are not able to use the parallel API (e.g. if you need to add and remove coroutines from the executing set dynamically), you can build your own dispatcher that delivers events in the same way as the parallel API—looking at the source code to the parallel API may be useful here.&lt;br /&gt;
&lt;br /&gt;
If you choose to use coroutines in a different way, then &amp;lt;code&amp;gt;os.pullEventRaw&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;os.pullEvent&amp;lt;/code&amp;gt; will not work. This in turn will break any other API function which is written on top of &amp;lt;code&amp;gt;os.pullEvent&amp;lt;/code&amp;gt;. As a guideline, nearly any API function that can possibly take time to complete will fall into this category; some examples are:&lt;br /&gt;
* [[rednet.receive]] blocks until either a [[Rednet message (event)|rednet_message event]] or (if a timeout was requested) a matching [[Timer (event)|timer event]] occurs.&lt;br /&gt;
* [[Gps (API)|gps.locate]] blocks until either a number of [[Modem message (event)|modem_message events]] or (if a timeout was requested) a matching [[Timer (event)|timer event]] occurs.&lt;br /&gt;
* [[http.get]] blocks until an [[Http success (event)|HTTP success event]] or [[Http failure (event)|HTTP failure event]] occurs.&lt;br /&gt;
* [[IO (API)|io.read]] and the built-in [[read]] functions block waiting for, presumably, either [[Char (event)|char events]] or [[Key (event)|key events]].&lt;br /&gt;
* [[os.sleep]] blocks until a matching [[Timer (event)|timer event]] occurs.&lt;br /&gt;
* [[textutils.slowPrint]] calls [[os.sleep]].&lt;br /&gt;
* [[textutils.pagedPrint]] blocks until a [[Key (event)|key event]] occurs for each page.&lt;br /&gt;
* Most of the functions in the [[Turtle (API)|turtle API]] (with the exception of [[turtle.getItemCount]], [[turtle.getItemSpace]], and [[turtle.getFuelLevel]]) block waiting for a [[Turtle response (event)|turtle response event]].&lt;br /&gt;
&lt;br /&gt;
Most of these can be worked around by using non-blocking equivalents that return immediately and then queue an event on completion (such as using [[http.request]]) or that deliver an event unconditionally (such as [[Char (Event)|char]] for keyboard input), then handling events in a way that is suitable for the application. However, if possible, it will often be easier to implement event dispatching instead, remembering that [[os.queueEvent]] can be used for inter-coroutine communication within an application. Another alternative, if you must use a custom protocol between your coroutines and dispatcher, might be to replace &amp;lt;code&amp;gt;os.pullEventRaw&amp;lt;/code&amp;gt; with a new function that uses a mechanism appropriate to the application.&lt;br /&gt;
&lt;br /&gt;
[[Category:APIs]]&lt;/div&gt;</summary>
		<author><name>Hawk777</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Keys.getName&amp;diff=5590</id>
		<title>Keys.getName</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Keys.getName&amp;diff=5590"/>
				<updated>2013-05-05T23:21:24Z</updated>
		
		<summary type="html">&lt;p&gt;Hawk777: Type-templateify, add nil return value possibility on failure, and clarify description&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase}}&lt;br /&gt;
{{Function&lt;br /&gt;
|name=keys.getName&lt;br /&gt;
|args={{type|int}} code&lt;br /&gt;
|api=keys&lt;br /&gt;
|returns={{type|string}} the name of the key, or [[nil]] if not a valid key code&lt;br /&gt;
|addon=ComputerCraft&lt;br /&gt;
|desc=Translates a numerical key code to a human-readable name. The human-readable name is one of the constants in the [[Keys (API)|keys API]].&lt;br /&gt;
|examples=&lt;br /&gt;
{{Example&lt;br /&gt;
|desc=Look up the name of key code 42.&lt;br /&gt;
|code=print(keys.getName(42))&lt;br /&gt;
|output=leftShift&lt;br /&gt;
}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:API_Functions]]&lt;/div&gt;</summary>
		<author><name>Hawk777</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Keys_(API)&amp;diff=5589</id>
		<title>Keys (API)</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Keys_(API)&amp;diff=5589"/>
				<updated>2013-05-05T23:19:40Z</updated>
		
		<summary type="html">&lt;p&gt;Hawk777: Add return type column&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Keys API provides a table of numerical codes corresponding to keyboard keys, suitable for decoding [[Key (event)|key events]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table style=&amp;quot;width: 100%; border: solid 1px black; margin: 2px; border-spacing: 0px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td colspan=&amp;quot;3&amp;quot; style=&amp;quot;font-weight: bold; font-size: large; padding-bottom: .3em; border-bottom: solid #C9C9C9 1px; background: #D3FFC2; line-height:28px;&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Grid_disk.png|24px]]&amp;amp;nbsp;&amp;amp;nbsp;&lt;br /&gt;
keys (API)&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td style=&amp;quot;width: 100px; background: #E0E0E0; padding: .4em; font-weight:bold;&amp;quot;&amp;gt;Return&amp;lt;/td&amp;gt;&amp;lt;td style=&amp;quot;width: 350px; background: #E0E0E0; padding: .4em; font-weight:bold;&amp;quot;&amp;gt;Method Name&amp;lt;/td&amp;gt;&amp;lt;td style=&amp;quot;background: #E0E0E0; padding: .4em; font-weight:bold;&amp;quot;&amp;gt;Description&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #FFFFFF;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;{{type|string}} keyName&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[keys.getName]]({{type|int}} code)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Translates a numerical key code to a human-readable name.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although this API contains only one method, it also contains a vast number of constants, one per key, containing the numerical key codes for those keys. As of ComputerCraft 1.52, the following constants are defined:&lt;br /&gt;
* a&lt;br /&gt;
* b&lt;br /&gt;
* c&lt;br /&gt;
* d&lt;br /&gt;
* e&lt;br /&gt;
* f&lt;br /&gt;
* g&lt;br /&gt;
* h&lt;br /&gt;
* i&lt;br /&gt;
* j&lt;br /&gt;
* k&lt;br /&gt;
* l&lt;br /&gt;
* m&lt;br /&gt;
* n&lt;br /&gt;
* o&lt;br /&gt;
* p&lt;br /&gt;
* q&lt;br /&gt;
* r&lt;br /&gt;
* s&lt;br /&gt;
* t&lt;br /&gt;
* u&lt;br /&gt;
* v&lt;br /&gt;
* w&lt;br /&gt;
* x&lt;br /&gt;
* y&lt;br /&gt;
* z&lt;br /&gt;
* one&lt;br /&gt;
* two&lt;br /&gt;
* three&lt;br /&gt;
* four&lt;br /&gt;
* five&lt;br /&gt;
* six&lt;br /&gt;
* seven&lt;br /&gt;
* eight&lt;br /&gt;
* nine&lt;br /&gt;
* zero&lt;br /&gt;
* minus&lt;br /&gt;
* equals&lt;br /&gt;
* backspace&lt;br /&gt;
* tab&lt;br /&gt;
* leftBracket&lt;br /&gt;
* rightBracket&lt;br /&gt;
* enter&lt;br /&gt;
* leftCtrl&lt;br /&gt;
* semiColon&lt;br /&gt;
* apostrophe&lt;br /&gt;
* grave&lt;br /&gt;
* leftShift&lt;br /&gt;
* backslash&lt;br /&gt;
* comma&lt;br /&gt;
* period&lt;br /&gt;
* slash&lt;br /&gt;
* rightShift&lt;br /&gt;
* multiply&lt;br /&gt;
* leftAlt&lt;br /&gt;
* space&lt;br /&gt;
* capsLock&lt;br /&gt;
* f1&lt;br /&gt;
* f2&lt;br /&gt;
* f3&lt;br /&gt;
* f4&lt;br /&gt;
* f5&lt;br /&gt;
* f6&lt;br /&gt;
* f7&lt;br /&gt;
* f8&lt;br /&gt;
* f9&lt;br /&gt;
* f10&lt;br /&gt;
* numLock&lt;br /&gt;
* scollLock&lt;br /&gt;
* numPad7&lt;br /&gt;
* numPad8&lt;br /&gt;
* numPad9&lt;br /&gt;
* numPadSubtract&lt;br /&gt;
* numPad4&lt;br /&gt;
* numPad5&lt;br /&gt;
* numPad6&lt;br /&gt;
* numPadAdd&lt;br /&gt;
* numPad1&lt;br /&gt;
* numPad2&lt;br /&gt;
* numPad3&lt;br /&gt;
* numPad0&lt;br /&gt;
* numPadDecimal&lt;br /&gt;
* f11&lt;br /&gt;
* f12&lt;br /&gt;
* f13&lt;br /&gt;
* f14&lt;br /&gt;
* f15&lt;br /&gt;
* kana&lt;br /&gt;
* convert&lt;br /&gt;
* noconvert&lt;br /&gt;
* yen&lt;br /&gt;
* numPadEquals&lt;br /&gt;
* cimcumflex&lt;br /&gt;
* at&lt;br /&gt;
* colon&lt;br /&gt;
* underscore&lt;br /&gt;
* kanji&lt;br /&gt;
* stop&lt;br /&gt;
* ax&lt;br /&gt;
* numPadEnter&lt;br /&gt;
* rightCtrl&lt;br /&gt;
* numPadComma&lt;br /&gt;
* numPadDivide&lt;br /&gt;
* rightAlt&lt;br /&gt;
* pause&lt;br /&gt;
* home&lt;br /&gt;
* up&lt;br /&gt;
* pageUp&lt;br /&gt;
* left&lt;br /&gt;
* right&lt;br /&gt;
* end&lt;br /&gt;
* down&lt;br /&gt;
* pageDown&lt;br /&gt;
* insert&lt;br /&gt;
* delete&lt;br /&gt;
&lt;br /&gt;
[[Category:APIs]]&lt;/div&gt;</summary>
		<author><name>Hawk777</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Key_(event)&amp;diff=5588</id>
		<title>Key (event)</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Key_(event)&amp;diff=5588"/>
				<updated>2013-05-05T23:18:47Z</updated>
		
		<summary type="html">&lt;p&gt;Hawk777: Add note about scan codes; note escape is not seen; remove needswork banner as an example has, in fact, been added earlier&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Event&lt;br /&gt;
|name=key&lt;br /&gt;
|desc=Fired when any key except Escape is pressed while the terminal is focused.&lt;br /&gt;
|return1=The numerical key value of the key pressed&lt;br /&gt;
}}&lt;br /&gt;
{{Example&lt;br /&gt;
|desc=Print each key pressed on the keyboard whenever a ''key'' event is fired. Use Ctrl+T (Windows)&amp;lt;!--- or ???+T (Mac)---&amp;gt; to terminate the loop.&lt;br /&gt;
|code=&lt;br /&gt;
 while true do&lt;br /&gt;
   event, scancode = os.pullEvent(&amp;quot;key&amp;quot;)&lt;br /&gt;
   print(tostring(scancode)..&amp;quot; was pressed.&amp;quot;)&lt;br /&gt;
 end&lt;br /&gt;
|output=Any key that is pressed.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Key scan codes ==&lt;br /&gt;
[[File:CC-Keyboard-Charcodes.png|center|frame|250x250px|Click for a larger copy of this image - contains keys and their event numbers.]]&lt;br /&gt;
&lt;br /&gt;
These scan codes are also available as constants in the [[Keys (API)|keys API]], and can be translated from numerical codes to strings using [[keys.getName]].&lt;/div&gt;</summary>
		<author><name>Hawk777</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Http.post&amp;diff=5587</id>
		<title>Http.post</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Http.post&amp;diff=5587"/>
				<updated>2013-05-05T23:15:28Z</updated>
		
		<summary type="html">&lt;p&gt;Hawk777: Type-templatify, link to handles documentation in API page, deduplicate description&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase}}&lt;br /&gt;
{{Function&lt;br /&gt;
|name=http.post&lt;br /&gt;
|args={{type|string}} url, {{type|string}} postData&lt;br /&gt;
|api=HTTP&lt;br /&gt;
|returns={{type|table}} a [[HTTP (API)#Handles|handle]] on success, or [[nil]] on failure&lt;br /&gt;
|addon=ComputerCraft&lt;br /&gt;
|desc=Sends a HTTP POST request to a website, synchronously. Returns when the request completes, successfully or not.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Lua_Core_Functions]]&lt;/div&gt;</summary>
		<author><name>Hawk777</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Http.get&amp;diff=5586</id>
		<title>Http.get</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Http.get&amp;diff=5586"/>
				<updated>2013-05-05T23:14:06Z</updated>
		
		<summary type="html">&lt;p&gt;Hawk777: Type-templatify, link to handles documentation in API page, deduplicate description, tidy URL in example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase}}&lt;br /&gt;
{{Function&lt;br /&gt;
|name=http.get&lt;br /&gt;
|args={{type|string}} url&lt;br /&gt;
|api=HTTP&lt;br /&gt;
|returns={{type|table}} a [[HTTP (API)#Handles|handle]] on success, or [[nil]] on failure&lt;br /&gt;
|addon=ComputerCraft&lt;br /&gt;
|desc=Sends a HTTP GET request to a website, synchronously. Returns when the request completes, successfully or not.&lt;br /&gt;
|examples=&lt;br /&gt;
{{Example&lt;br /&gt;
|desc=Gets the content of example.com (in HTML)&lt;br /&gt;
|code=local sExample = http.get(&amp;quot;http://example.com/&amp;quot;) --Get contents of page&amp;lt;br /&amp;gt;write(sExample.readAll()) --Read and print contents of page&amp;lt;br /&amp;gt;sExample.close() --Just in case&lt;br /&gt;
|output=The source of http://example.com/&lt;br /&gt;
}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Lua_Core_Functions]]&lt;/div&gt;</summary>
		<author><name>Hawk777</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Http.request&amp;diff=5585</id>
		<title>Http.request</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Http.request&amp;diff=5585"/>
				<updated>2013-05-05T23:10:50Z</updated>
		
		<summary type="html">&lt;p&gt;Hawk777: Document asynchrony&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase}}&lt;br /&gt;
{{Function&lt;br /&gt;
|name=http.request&lt;br /&gt;
|args={{type|string}} url&amp;lt;nowiki&amp;gt;[&amp;lt;/nowiki&amp;gt;, {{type|string}} postData]&lt;br /&gt;
|api=HTTP&lt;br /&gt;
|addon=ComputerCraft&lt;br /&gt;
|desc=Sends a HTTP request to a website, asynchronously. Returns immediately, with an [[Http success (event)|http_success]] or [[Http failure (event)|http_failure]] event being delivered later to indicate the outcome. Issues a POST request if ''postData'' is provided, or a GET request if it is [[nil]] (or omitted).&lt;br /&gt;
|examples=&lt;br /&gt;
{{Example&lt;br /&gt;
|desc=Prints the code of a loading bar program if successful.&lt;br /&gt;
|code=http.request(&amp;quot;http://pastebin.com/raw.php?i=Tk19jv43&amp;quot;)&lt;br /&gt;
  local requesting = true&lt;br /&gt;
  while requesting do&lt;br /&gt;
    local event, url, sourceText = os.pullEvent()&lt;br /&gt;
    if event == &amp;quot;http_success&amp;quot; then&lt;br /&gt;
      local respondedText = sourceText.readAll()&lt;br /&gt;
      print(respondedText)&lt;br /&gt;
      requesting = false&lt;br /&gt;
    elseif event == &amp;quot;http_failure&amp;quot; then&lt;br /&gt;
      print(&amp;quot;Server didn't respond.&amp;quot;)&lt;br /&gt;
      requesting = false&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Lua_Core_Functions]]&lt;/div&gt;</summary>
		<author><name>Hawk777</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=HTTP_(API)&amp;diff=5584</id>
		<title>HTTP (API)</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=HTTP_(API)&amp;diff=5584"/>
				<updated>2013-05-05T23:10:35Z</updated>
		
		<summary type="html">&lt;p&gt;Hawk777: Document synchrony and asynchrony&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;:{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| '''The HTTP API must be enabled in mod_ComputerCraft.cfg before being used. To enable it open .minecraft/config/ComputerCraft.cfg and change enableAPI_http=false to enableAPI_http=true.'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The HTTP API allows interfacing with websites and downloading from them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table style=&amp;quot;width: 100%; border: solid 1px black; margin: 2px; border-spacing: 0px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td colspan=&amp;quot;3&amp;quot; style=&amp;quot;font-weight: bold; font-size: large; padding-bottom: .3em; border-bottom: solid #C9C9C9 1px; background: #D3FFC2; line-height:28px;&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Grid_disk.png|24px]]&amp;amp;nbsp;&amp;amp;nbsp;&lt;br /&gt;
HTTP (API)&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td style=&amp;quot;width: 100px; background: #E0E0E0; padding: .4em; font-weight:bold;&amp;quot;&amp;gt;Return&amp;lt;/td&amp;gt;&amp;lt;td style=&amp;quot;width: 350px; background: #E0E0E0; padding: .4em; font-weight:bold;&amp;quot;&amp;gt;Method Name&amp;lt;/td&amp;gt;&amp;lt;td style=&amp;quot;background: #E0E0E0; padding: .4em; font-weight:bold;&amp;quot;&amp;gt;Description&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #FFFFFF;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[nil]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[http.request]]({{type|string}} url, &amp;lt;nowiki&amp;gt;[&amp;lt;/nowiki&amp;gt;{{type|string}} postData])&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Sends a HTTP request to a website, asynchronously.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #E8E8E8;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;{{type|table}} handle&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[http.get]]({{type|string}} url)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Sends a HTTP GET request to a website, synchronously.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #FFFFFF;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;{{type|table}} handle&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[http.post]]({{type|string}} url, {{type|string}} postData)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Sends a HTTP POST request to a website, synchronously.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[http.request]] is used to send a HTTP request that completes asynchronously and generates an event (one of [[Http success (event)|http_success]] or [[Http failure (event)|http_failure]]). [[http.get]] and [[http.post]] execute [[http.request]] and block until the operation completes.&lt;br /&gt;
&lt;br /&gt;
== Handles ==&lt;br /&gt;
All three operations make use of ''handles'', tables that contain functions to read data returned from the HTTP server. These handles act the same as the I/O handles returned by [[fs.open]] in read-only text mode, implementing the [[fs.open#Closing_a_file_handle|close]], [[fs.open#Files_opened_in_text_read_mode|readLine]], and [[fs.open#Files_opened_in_text_read_mode|readAll]] methods. These handles also implement the following function:&lt;br /&gt;
&lt;br /&gt;
{{Function&lt;br /&gt;
|name=&amp;lt;var&amp;gt;h&amp;lt;/var&amp;gt;.getResponseCode&lt;br /&gt;
|returns={{type|number}} HTTP response code&lt;br /&gt;
|api=HTTP&lt;br /&gt;
|desc=Returns the numerical [https://en.wikipedia.org/wiki/List_of_HTTP_status_codes HTTP response code] sent by the server&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:APIs]]&lt;/div&gt;</summary>
		<author><name>Hawk777</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Http.request&amp;diff=5583</id>
		<title>Http.request</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Http.request&amp;diff=5583"/>
				<updated>2013-05-05T23:09:51Z</updated>
		
		<summary type="html">&lt;p&gt;Hawk777: Document parameters, clarify description, remove return value (it DOES NOT return a value!), and remove excessive line breaks in example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase}}&lt;br /&gt;
{{Function&lt;br /&gt;
|name=http.request&lt;br /&gt;
|args={{type|string}} url&amp;lt;nowiki&amp;gt;[&amp;lt;/nowiki&amp;gt;, {{type|string}} postData]&lt;br /&gt;
|api=HTTP&lt;br /&gt;
|addon=ComputerCraft&lt;br /&gt;
|desc=Sends a HTTP request to a website. Returns immediately, with an [[Http success (event)|http_success]] or [[Http failure (event)|http_failure]] event being delivered later to indicate the outcome. Issues a POST request if ''postData'' is provided, or a GET request if it is [[nil]] (or omitted).&lt;br /&gt;
|examples=&lt;br /&gt;
{{Example&lt;br /&gt;
|desc=Prints the code of a loading bar program if successful.&lt;br /&gt;
|code=http.request(&amp;quot;http://pastebin.com/raw.php?i=Tk19jv43&amp;quot;)&lt;br /&gt;
  local requesting = true&lt;br /&gt;
  while requesting do&lt;br /&gt;
    local event, url, sourceText = os.pullEvent()&lt;br /&gt;
    if event == &amp;quot;http_success&amp;quot; then&lt;br /&gt;
      local respondedText = sourceText.readAll()&lt;br /&gt;
      print(respondedText)&lt;br /&gt;
      requesting = false&lt;br /&gt;
    elseif event == &amp;quot;http_failure&amp;quot; then&lt;br /&gt;
      print(&amp;quot;Server didn't respond.&amp;quot;)&lt;br /&gt;
      requesting = false&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Lua_Core_Functions]]&lt;/div&gt;</summary>
		<author><name>Hawk777</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Http_failure_(event)&amp;diff=5582</id>
		<title>Http failure (event)</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Http_failure_(event)&amp;diff=5582"/>
				<updated>2013-05-05T23:05:26Z</updated>
		
		<summary type="html">&lt;p&gt;Hawk777: Trim a bit, clarify description&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Event&lt;br /&gt;
|name=http_failure&lt;br /&gt;
|return1=The URL to the website&lt;br /&gt;
|desc=Fired when a call to [[http.request]] fails, and used internally in [[http.get]] and [[http.post]].&lt;br /&gt;
}}&lt;br /&gt;
{{Example&lt;br /&gt;
|desc=Prints a message and quits when the requested URL could not be contacted.&lt;br /&gt;
|code=&lt;br /&gt;
 http.request( &amp;quot;http://www.example-failure.com&amp;quot; )&lt;br /&gt;
 while true do&lt;br /&gt;
   event, url = os.pullEvent()&lt;br /&gt;
   if event == &amp;quot;http_failure&amp;quot; then&lt;br /&gt;
     print( &amp;quot;Cannot contact the server: &amp;quot;..url )&lt;br /&gt;
     break&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Hawk777</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Http_success_(event)&amp;diff=5581</id>
		<title>Http success (event)</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Http_success_(event)&amp;diff=5581"/>
				<updated>2013-05-05T23:03:52Z</updated>
		
		<summary type="html">&lt;p&gt;Hawk777: Trim a bit, clarify description, point back at the handle description in HTTP API&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Event&lt;br /&gt;
|name=http_success&lt;br /&gt;
|desc=Fired when a call to [[http.request]] completes successfully, and used internally in [[http.get]] and [[http.post]].&lt;br /&gt;
|return1=The URL to the website&lt;br /&gt;
|return2=A [[HTTP (API)#Handles|handle]] that allows reading the response sent from the server&lt;br /&gt;
}}&lt;br /&gt;
{{Example&lt;br /&gt;
|desc=Prints the response code from the server and the text returned from the server&lt;br /&gt;
|code=&lt;br /&gt;
 http.request( &amp;quot;http://www.example.com&amp;quot; )&lt;br /&gt;
 event, url, handle = os.pullEvent( &amp;quot;http_success&amp;quot; )&lt;br /&gt;
 print( &amp;quot;Got a response with the status code: &amp;quot;..handle.getResponseCode() )&lt;br /&gt;
 print( &amp;quot;With the text: &amp;quot;..handle.readAll() )&lt;br /&gt;
 handle:close()&lt;br /&gt;
}}&lt;br /&gt;
{{Example&lt;br /&gt;
|desc=Prints all the available functions to call on the response from the server&lt;br /&gt;
|code=&lt;br /&gt;
 http.request( &amp;quot;http://www.example.com&amp;quot; )&lt;br /&gt;
 while true do&lt;br /&gt;
   event, url, handle = os.pullEvent( &amp;quot;http_success&amp;quot; )&lt;br /&gt;
   for k, v in pairs( handle ) do&lt;br /&gt;
     print( k )&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Hawk777</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=HTTP_(API)&amp;diff=5580</id>
		<title>HTTP (API)</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=HTTP_(API)&amp;diff=5580"/>
				<updated>2013-05-05T22:59:44Z</updated>
		
		<summary type="html">&lt;p&gt;Hawk777: Tidying, add return value column, add getResponseCode documentation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;:{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| '''The HTTP API must be enabled in mod_ComputerCraft.cfg before being used. To enable it open .minecraft/config/ComputerCraft.cfg and change enableAPI_http=false to enableAPI_http=true.'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The HTTP API allows interfacing with websites and downloading from them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table style=&amp;quot;width: 100%; border: solid 1px black; margin: 2px; border-spacing: 0px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td colspan=&amp;quot;3&amp;quot; style=&amp;quot;font-weight: bold; font-size: large; padding-bottom: .3em; border-bottom: solid #C9C9C9 1px; background: #D3FFC2; line-height:28px;&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Grid_disk.png|24px]]&amp;amp;nbsp;&amp;amp;nbsp;&lt;br /&gt;
HTTP (API)&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td style=&amp;quot;width: 100px; background: #E0E0E0; padding: .4em; font-weight:bold;&amp;quot;&amp;gt;Return&amp;lt;/td&amp;gt;&amp;lt;td style=&amp;quot;width: 350px; background: #E0E0E0; padding: .4em; font-weight:bold;&amp;quot;&amp;gt;Method Name&amp;lt;/td&amp;gt;&amp;lt;td style=&amp;quot;background: #E0E0E0; padding: .4em; font-weight:bold;&amp;quot;&amp;gt;Description&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #FFFFFF;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[nil]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[http.request]]({{type|string}} url, &amp;lt;nowiki&amp;gt;[&amp;lt;/nowiki&amp;gt;{{type|string}} postData])&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Sends a HTTP request to a website.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #E8E8E8;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;{{type|table}} handle&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[http.get]]({{type|string}} url)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Sends a HTTP GET request to a website.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #FFFFFF;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;{{type|table}} handle&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[http.post]]({{type|string}} url, {{type|string}} postData)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Sends a HTTP POST request to a website.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[http.request]] is used to send a HTTP request that completes asynchronously and generates an event (one of [[Http success (event)|http_success]] or [[Http failure (event)|http_failure]]). [[http.get]] and [[http.post]] execute [[http.request]] and block until the operation completes.&lt;br /&gt;
&lt;br /&gt;
== Handles ==&lt;br /&gt;
All three operations make use of ''handles'', tables that contain functions to read data returned from the HTTP server. These handles act the same as the I/O handles returned by [[fs.open]] in read-only text mode, implementing the [[fs.open#Closing_a_file_handle|close]], [[fs.open#Files_opened_in_text_read_mode|readLine]], and [[fs.open#Files_opened_in_text_read_mode|readAll]] methods. These handles also implement the following function:&lt;br /&gt;
&lt;br /&gt;
{{Function&lt;br /&gt;
|name=&amp;lt;var&amp;gt;h&amp;lt;/var&amp;gt;.getResponseCode&lt;br /&gt;
|returns={{type|number}} HTTP response code&lt;br /&gt;
|api=HTTP&lt;br /&gt;
|desc=Returns the numerical [https://en.wikipedia.org/wiki/List_of_HTTP_status_codes HTTP response code] sent by the server&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:APIs]]&lt;/div&gt;</summary>
		<author><name>Hawk777</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Help_(API)&amp;diff=5513</id>
		<title>Help (API)</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Help_(API)&amp;diff=5513"/>
				<updated>2013-04-23T19:53:31Z</updated>
		
		<summary type="html">&lt;p&gt;Hawk777: Add return column, use type template, and update descriptions&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Help API allows you to mess around with the help files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table style=&amp;quot;width: 100%; border: solid 1px black; margin: 2px; border-spacing: 0px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td colspan=&amp;quot;3&amp;quot; style=&amp;quot;font-weight: bold; font-size: large; padding-bottom: .3em; border-bottom: solid #C9C9C9 1px; background: #D3FFC2; line-height:28px;&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Grid_disk.png|24px]]&amp;amp;nbsp;&amp;amp;nbsp;&lt;br /&gt;
Help (API)&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td style=&amp;quot;width: 100px; background: #E0E0E0; padding: .4em; font-weight:bold;&amp;quot;&amp;gt;Return&amp;lt;/td&amp;gt;&amp;lt;td style=&amp;quot;width: 350px; background: #E0E0E0; padding: .4em; font-weight:bold;&amp;quot;&amp;gt;Method Name&amp;lt;/td&amp;gt;&amp;lt;td style=&amp;quot;background: #E0E0E0; padding: .4em; font-weight:bold;&amp;quot;&amp;gt;Description&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #FFFFFF;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;{{Type|string}} path&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[help.path]]()&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Returns the list of locations the API will look in for help files.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #E8E8E8;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[nil]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[help.setPath]]({{Type|string}} path)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Sets the list of locations the API will look in for help files.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #FFFFFF;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;{{Type|string}} path, or [[nil]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[help.lookup]]({{Type|string}} topic)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Returns the path to the file containing the help page for &amp;lt;var&amp;gt;topic&amp;lt;/var&amp;gt;, or [[nil]] if the topic cannot be found.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #E8E8E8;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;{{Type|table}} topics&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[help.topics]]()&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Returns a list of all available help topics.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:APIs]]&lt;br /&gt;
td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Returns the list of locations the API will look in for help files.&lt;/div&gt;</summary>
		<author><name>Hawk777</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Help.topics&amp;diff=5512</id>
		<title>Help.topics</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Help.topics&amp;diff=5512"/>
				<updated>2013-04-23T19:53:28Z</updated>
		
		<summary type="html">&lt;p&gt;Hawk777: Update description, reformat example and use ipairs to get sorted output, and use type template&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase}}&lt;br /&gt;
{{Function&lt;br /&gt;
|name=help.topics&lt;br /&gt;
|api=help&lt;br /&gt;
|returns={{Type|table}} all valid topics&lt;br /&gt;
|addon=ComputerCraft&lt;br /&gt;
|desc=Returns a list of all available help topics. This is all files found in the directories in the search path returned by [[help.path]]. The returned table is sorted.&lt;br /&gt;
|examples=&lt;br /&gt;
{{Example&lt;br /&gt;
|desc=Lists all valid help topics.&lt;br /&gt;
|code=for _, v in ipairs(help.topics()) do&lt;br /&gt;
   print(v)&lt;br /&gt;
 end&lt;br /&gt;
|output=List of all valid help topics&lt;br /&gt;
}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:API_Functions]]&lt;/div&gt;</summary>
		<author><name>Hawk777</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Help.lookup&amp;diff=5511</id>
		<title>Help.lookup</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Help.lookup&amp;diff=5511"/>
				<updated>2013-04-23T19:53:26Z</updated>
		
		<summary type="html">&lt;p&gt;Hawk777: Update description and use type template&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase}}&lt;br /&gt;
{{Function&lt;br /&gt;
|name=help.lookup&lt;br /&gt;
|args={{Type|string}} topic&lt;br /&gt;
|api=help&lt;br /&gt;
|returns={{Type|string}} path of help file for &amp;lt;var&amp;gt;topic&amp;lt;/var&amp;gt; or [[nil]]&lt;br /&gt;
|addon=ComputerCraft&lt;br /&gt;
|desc=Returns the path to the file containing the help page for &amp;lt;var&amp;gt;topic&amp;lt;/var&amp;gt;, or [[nil]] if the topic cannot be found. Each element of the string returned by [[help.path]] is searched, in order, for a file named &amp;lt;var&amp;gt;topic&amp;lt;/var&amp;gt;.&lt;br /&gt;
|examples=&lt;br /&gt;
{{Example&lt;br /&gt;
|desc=Looks up the path for help on the disk API.&lt;br /&gt;
|code=print(help.lookup(&amp;quot;disk&amp;quot;))&lt;br /&gt;
|output=/rom/help/disk&lt;br /&gt;
}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:API_Functions]]&lt;/div&gt;</summary>
		<author><name>Hawk777</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Help.setPath&amp;diff=5510</id>
		<title>Help.setPath</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Help.setPath&amp;diff=5510"/>
				<updated>2013-04-23T19:53:24Z</updated>
		
		<summary type="html">&lt;p&gt;Hawk777: Update description and use type template&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase}}&lt;br /&gt;
{{Function&lt;br /&gt;
|name=help.setPath&lt;br /&gt;
|args={{Type|string}} path&lt;br /&gt;
|api=help&lt;br /&gt;
|addon=ComputerCraft&lt;br /&gt;
|desc=Returns the list of locations the API will look in for help files. This should be a string containing one or more search paths separated by colons.&lt;br /&gt;
|examples=&lt;br /&gt;
{{Example&lt;br /&gt;
|desc=Sets the search path of the help API to /disk/help.&lt;br /&gt;
|code=help.setPath(&amp;quot;/disk/help&amp;quot;)&lt;br /&gt;
}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:API_Functions]]&lt;/div&gt;</summary>
		<author><name>Hawk777</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Help.path&amp;diff=5509</id>
		<title>Help.path</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Help.path&amp;diff=5509"/>
				<updated>2013-04-23T19:53:22Z</updated>
		
		<summary type="html">&lt;p&gt;Hawk777: Update description and use type template&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase}}&lt;br /&gt;
{{Function&lt;br /&gt;
|name=help.path&lt;br /&gt;
|api=help&lt;br /&gt;
|returns={{Type|string}} the path list, separated by colons&lt;br /&gt;
|addon=ComputerCraft&lt;br /&gt;
|desc=Returns the list of locations the API will look in for help files. This is returned in the form of a string containing multiple search paths separated by colons.&lt;br /&gt;
|examples=&lt;br /&gt;
{{Example&lt;br /&gt;
|desc=Prints the current path list for the help API.&lt;br /&gt;
|code=print(help.path())&lt;br /&gt;
|output=/rom/help&lt;br /&gt;
}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:API_Functions]]&lt;/div&gt;</summary>
		<author><name>Hawk777</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Gps_(API)&amp;diff=5508</id>
		<title>Gps (API)</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Gps_(API)&amp;diff=5508"/>
				<updated>2013-04-23T19:37:20Z</updated>
		
		<summary type="html">&lt;p&gt;Hawk777: Add return column to table, shift types over into return and method name columns, and reduce description by removing that information&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The GPS API provides a method for turtles and computers to retrieve their own locations.&lt;br /&gt;
&lt;br /&gt;
It broadcasts a PING message over [[Rednet_(API)|rednet]] and wait for responses. In order for this system to work, there must be at least 4 computers used as gps ''hosts'' which will respond and allow [[Wikipedia:Trilateration|trilateration]]. Three of these hosts should be in a plane, and the fourth should be either above or below the other three. You can set up hosts using the [[Gps (program)|gps program]].&lt;br /&gt;
&lt;br /&gt;
Note:  When entering in the coordinates for the ''host'' you need to put in the x,y,z of the computer, not the modem, as all rednet distances are measured from the block the computer is in. &lt;br /&gt;
&amp;lt;!-- do not edit this without actually testing it yourself --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table style=&amp;quot;width: 100%; border: solid 1px black; margin: 2px; border-spacing: 0px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td colspan=&amp;quot;3&amp;quot; style=&amp;quot;font-weight: bold; font-size: large; padding-bottom: .3em; border-bottom: solid #C9C9C9 1px; background: #D3FFC2; line-height:28px;&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Grid_disk.png|24px]]&amp;amp;nbsp;&amp;amp;nbsp;&lt;br /&gt;
Gps (API)&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td style=&amp;quot;width: 100px; background: #E0E0E0; padding: .4em; font-weight:bold;&amp;quot;&amp;gt;Return&amp;lt;/td&amp;gt;&amp;lt;td style=&amp;quot;width: 350px; background: #E0E0E0; padding: .4em; font-weight:bold;&amp;quot;&amp;gt;Method Name&amp;lt;/td&amp;gt;&amp;lt;td style=&amp;quot;background: #E0E0E0; padding: .4em; font-weight:bold;&amp;quot;&amp;gt;Description&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #FFFFFF;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;({{Type|int}} x, {{Type|int}} y, {{Type|int}} z), or [[nil]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;gps.locate(&amp;lt;nowiki&amp;gt;[&amp;lt;/nowiki&amp;gt;{{Type|float}} timeout, &amp;lt;nowiki&amp;gt;[&amp;lt;/nowiki&amp;gt;{{Type|boolean}} debug]])&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Tries to retrieve the computer or turtles own location. On success, returns the location of the turtle’s modem. On failure (if no responses are received for &amp;lt;var&amp;gt;timeout&amp;lt;/var&amp;gt; seconds, by default 2), returns [[nil]]. If &amp;lt;var&amp;gt;debug&amp;lt;/var&amp;gt; is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, debug messages are printed.&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
  print(&amp;quot;Man I am so lost right now!&amp;quot;)&lt;br /&gt;
  local x, y, z = gps.locate(5)&lt;br /&gt;
  if x == nil then&lt;br /&gt;
    print(&amp;quot;Nope, still lost :(&amp;quot;)&lt;br /&gt;
  else&lt;br /&gt;
    print(&amp;quot;I am at &amp;quot;,x,&amp;quot; &amp;quot;,y,&amp;quot; &amp;quot;,z)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
== Vector Example ==&lt;br /&gt;
GPS position and navigation can be handled more easily using a [[vector (API)|vector]].&lt;br /&gt;
&lt;br /&gt;
  local home = vector.new(45, 85, 20)&lt;br /&gt;
  local position = vector.new(gps.locate(5))&lt;br /&gt;
  local displacement = position - home&lt;br /&gt;
  &lt;br /&gt;
  print(&amp;quot;I am &amp;quot;, displacement.tostring(), &amp;quot; away from home!!!&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:APIs]]&lt;br /&gt;
code&amp;gt;true&lt;/div&gt;</summary>
		<author><name>Hawk777</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Coroutine_(API)&amp;diff=5507</id>
		<title>Coroutine (API)</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Coroutine_(API)&amp;diff=5507"/>
				<updated>2013-04-23T19:20:02Z</updated>
		
		<summary type="html">&lt;p&gt;Hawk777: /* Interaction with Other APIs */ Explain how one might potentially do event dispatch&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;:{| border=&amp;quot;1&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| '''Bug'''&lt;br /&gt;
'''From ComputerCraft 1.3''' this API suffers from the problem of potentially spawning Java threads that live forever therefore, use of coroutines should be minimized. This is '''fixed in ComputerCraft 1.32+''', though.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
''This is for the Coroutine API. For the Coroutine Object, visit [[Coroutine (type)]].''&lt;br /&gt;
&lt;br /&gt;
Coroutine is a default Lua 5.1 API defined [http://www.lua.org/manual/5.1/manual.html#5.2 here]. Please list any non-working functions on this page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table style=&amp;quot;width: 100%; border: solid 1px black; margin: 2px; border-spacing: 0px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td colspan=&amp;quot;3&amp;quot; style=&amp;quot;font-weight: bold; font-size: large; padding-bottom: .3em; border-bottom: solid #C9C9C9 1px; background: #D3FFC2; line-height:28px;&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Grid_disk.png|24px]]&amp;amp;nbsp;&amp;amp;nbsp;&lt;br /&gt;
Coroutine (API)&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td style=&amp;quot;width: 100px; background: #E0E0E0; padding: .4em; font-weight:bold;&amp;quot;&amp;gt;Return&amp;lt;/td&amp;gt;&amp;lt;td style=&amp;quot;width: 350px; background: #E0E0E0; padding: .4em; font-weight:bold;&amp;quot;&amp;gt;Method Name&amp;lt;/td&amp;gt;&amp;lt;td style=&amp;quot;background: #E0E0E0; padding: .4em; font-weight:bold;&amp;quot;&amp;gt;Description&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #FFFFFF;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;{{Type|coroutine}} coro&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[coroutine.create]]({{Type|function}} f)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Creates a new coroutine.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #E8E8E8;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;{{Type|boolean}} success, …&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[coroutine.resume]]({{Type|coroutine}} coro, [var1], [var2], ...)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Starts or resumes an existing coroutine.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #FFFFFF;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;{{Type|coroutine}} coro&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[coroutine.running]]()&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Returns the currently executing coroutine.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #E8E8E8;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;{{Type|string}} status&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[coroutine.status]](coroutine)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Returns the status of the given coroutine.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #FFFFFF;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;{{Type|function}} coroutine wrapper&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[coroutine.wrap]](function)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Creates a new coroutine and wraps it in a function.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #E8E8E8;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[var3], [var4], …&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[coroutine.yield]]([var1], [var2], …)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Pauses the currently executing coroutine and passes control to its caller.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Coroutine States and Ancestry ==&lt;br /&gt;
Every coroutine is in one of four states:&lt;br /&gt;
* A ''suspended'' coroutine is one that has not yet been started or that has yielded. A suspended coroutine can become running if it is passed to [[coroutine.resume]].&lt;br /&gt;
* A ''running'' coroutine is one that is currently executing code. Only one coroutine can be running at a time on a particular computer. A running coroutine can become suspended if it [[coroutine.yield]], normal if it calls [[coroutine.resume]] on another coroutine, or dead by if it returns from its body function.&lt;br /&gt;
* A ''normal'' coroutine is one that, while running, resumed another coroutine (the ''child coroutine''). A normal coroutine can become running if its child calls [[coroutine.yield]] or returns from its function body.&lt;br /&gt;
* A ''dead'' coroutine is one that, while running, returned from its function body. A dead coroutine can never change state.&lt;br /&gt;
&lt;br /&gt;
While suspended and dead coroutines simply sit loose with no connections to other coroutines, normal and running coroutines have an ancestry relationship between them. Exactly one coroutine is running at any given time, and the running coroutine has no children. Every running or normal coroutine except the top-level BIOS coroutine has a parent, and this relationship forms a chain with one end (the furthest ancestor) being the top-level BIOS coroutine and the other end (the furthest descendant) being the running coroutine. Remember that only the running coroutine can actually execute code, so any functions invoked must be invoked by that coroutine. Then, calling [[coroutine.resume]] makes the chain longer by taking a previously suspended coroutine, hanging it underneath the current coroutine as a new child, and making the current coroutine normal and the new child running. Meanwhile, calling [[coroutine.yield]] makes the chain shorter by turning the currently executing coroutine into a suspended coroutine, detaching it from the chain, and letting its former parent become running.&lt;br /&gt;
&lt;br /&gt;
It is important not to confuse this coroutine chain with the function call stack. Each individual coroutine contains a complete function call stack of its own, rooted at the coroutine’s body function, whether the coroutine is running, normal, or suspended; the chain described in the previous paragraph refers to how entire coroutines are connected together.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
As the coroutine API is very tightly coupled and many of its function must be used to get any interesting results, examples are shown here instead of on the individual function pages.&lt;br /&gt;
&lt;br /&gt;
=== Using the Basic Coroutine Functions ===&lt;br /&gt;
This example demonstrates using the basic coroutine functions to pass control and data between coroutines. This example prints the numbers 1 through 17 in order, showing how control flow moves through the main program coroutine and the two created coroutines, while using assertions to show how data flows through the program:&lt;br /&gt;
&lt;br /&gt;
 -- These variables will hold the coroutine objects.&lt;br /&gt;
 local c1 = nil&lt;br /&gt;
 local c2 = nil&lt;br /&gt;
 &lt;br /&gt;
 -- This function will be the body of the first coroutine.&lt;br /&gt;
 local function f1(x)&lt;br /&gt;
   -- The main code, below, starts c1 first, passing 1.&lt;br /&gt;
   -- Thus c1 should be running, c2 should be suspended (not started yet), and x should receive the value from main, 1.&lt;br /&gt;
   -- STEP 2: Check these assumptions.&lt;br /&gt;
   print(2)&lt;br /&gt;
   assert(coroutine.status(c1) == &amp;quot;running&amp;quot;)&lt;br /&gt;
   assert(coroutine.status(c2) == &amp;quot;suspended&amp;quot;)&lt;br /&gt;
   assert(x == 1)&lt;br /&gt;
   -- STEP 3: Run c2 until it yields, start it off with the value 2.&lt;br /&gt;
   print(3)&lt;br /&gt;
   success, value = coroutine.resume(c2, 2)&lt;br /&gt;
   assert(success)&lt;br /&gt;
   -- In step 6, c2 yields and passes back the value 3.&lt;br /&gt;
   -- Then c2, having yielded, should be suspended, and c1 should be running again.&lt;br /&gt;
   -- STEP 7: Check all that.&lt;br /&gt;
   print(7)&lt;br /&gt;
   assert(coroutine.status(c1) == &amp;quot;running&amp;quot;)&lt;br /&gt;
   assert(coroutine.status(c2) == &amp;quot;suspended&amp;quot;)&lt;br /&gt;
   assert(value == 3)&lt;br /&gt;
   -- STEP 8: Run c2 again, passing it the value 4.&lt;br /&gt;
   -- Since c2 has already run before, this time the 4 will come out of the yield() instead of appear as a function parameter.&lt;br /&gt;
   print(8)&lt;br /&gt;
   success, value = coroutine.resume(c2, 4)&lt;br /&gt;
   -- In step 10, c2 yields and passes back the value 5.&lt;br /&gt;
   -- Then c2, having yielded, should be suspended, and c1 should be running again.&lt;br /&gt;
   -- STEP 11: Check all that.&lt;br /&gt;
   print(11)&lt;br /&gt;
   assert(coroutine.status(c1) == &amp;quot;running&amp;quot;)&lt;br /&gt;
   assert(coroutine.status(c2) == &amp;quot;suspended&amp;quot;)&lt;br /&gt;
   assert(value == 5)&lt;br /&gt;
   -- STEP 12: Yield, turning c1 back into a suspended coroutine and continuing execution of the main program, passing back value 6.&lt;br /&gt;
   print(12)&lt;br /&gt;
   value = coroutine.yield(6)&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 -- This function will be the body of the second coroutine.&lt;br /&gt;
 local function f2(x)&lt;br /&gt;
   -- The first time c2 is run, it is run from f1, which passes 2.&lt;br /&gt;
   -- Thus c1 should be normal (as we are nested inside it), c2 should be running, and x should receive the value from f1, 2.&lt;br /&gt;
   -- STEP 4: Check these assumptions.&lt;br /&gt;
   print(4)&lt;br /&gt;
   assert(coroutine.status(c1) == &amp;quot;normal&amp;quot;)&lt;br /&gt;
   assert(coroutine.status(c2) == &amp;quot;running&amp;quot;)&lt;br /&gt;
   assert(x == 2)&lt;br /&gt;
   -- Because c1 is not suspended, we should not be able to resume it.&lt;br /&gt;
   -- STEP 5: Check this is correct.&lt;br /&gt;
   print(5)&lt;br /&gt;
   success, value = coroutine.resume(c1)&lt;br /&gt;
   assert(not success)&lt;br /&gt;
   assert(value == &amp;quot;cannot resume normal coroutine&amp;quot;)&lt;br /&gt;
   -- STEP 6: Yield, turning c2 back into a suspended coroutine and continuing execution of c1, passing back value 3.&lt;br /&gt;
   print(6)&lt;br /&gt;
   value = coroutine.yield(3)&lt;br /&gt;
   -- In step 8, c1 resumed c2 again and passed the value 4.&lt;br /&gt;
   -- c2 should now be running again, and c1 normal again.&lt;br /&gt;
   -- STEP 9: Check all that.&lt;br /&gt;
   print(9)&lt;br /&gt;
   assert(coroutine.status(c1) == &amp;quot;normal&amp;quot;)&lt;br /&gt;
   assert(coroutine.status(c2) == &amp;quot;running&amp;quot;)&lt;br /&gt;
   assert(value == 4)&lt;br /&gt;
   -- STEP 10: Yield, turning c2 back into a suspended coroutine and continuing execution of c1, passing back value 5.&lt;br /&gt;
   print(10)&lt;br /&gt;
   value = coroutine.yield(5)&lt;br /&gt;
   -- In step 14, the main program resumed c2 directly and passed the value 7, bypassing c1.&lt;br /&gt;
   -- So c2 should be running and c1 should be suspended.&lt;br /&gt;
   -- STEP 15: Check all that.&lt;br /&gt;
   print(15)&lt;br /&gt;
   assert(coroutine.status(c1) == &amp;quot;suspended&amp;quot;)&lt;br /&gt;
   assert(coroutine.status(c2) == &amp;quot;running&amp;quot;)&lt;br /&gt;
   assert(value == 7)&lt;br /&gt;
   -- STEP 16: Now die, returning value 8 to the main program.&lt;br /&gt;
   print(16)&lt;br /&gt;
   return 8&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 -- Construct the two coroutines.&lt;br /&gt;
 c1 = coroutine.create(f1)&lt;br /&gt;
 c2 = coroutine.create(f2)&lt;br /&gt;
 &lt;br /&gt;
 -- Newly constructed coroutines are always suspended.&lt;br /&gt;
 assert(coroutine.status(c1) == &amp;quot;suspended&amp;quot;)&lt;br /&gt;
 assert(coroutine.status(c2) == &amp;quot;suspended&amp;quot;)&lt;br /&gt;
 &lt;br /&gt;
 -- STEP 1: Run c1 until it yields, starting it off with the value 1.&lt;br /&gt;
 print(1)&lt;br /&gt;
 success, value = coroutine.resume(c1, 1)&lt;br /&gt;
 assert(success)&lt;br /&gt;
 &lt;br /&gt;
 -- In step 12, c1 should have yielded and returned the value 6.&lt;br /&gt;
 -- So now c1 and c2 should both be suspended.&lt;br /&gt;
 -- STEP 13: Check all that.&lt;br /&gt;
 print(13)&lt;br /&gt;
 assert(coroutine.status(c1) == &amp;quot;suspended&amp;quot;)&lt;br /&gt;
 assert(coroutine.status(c2) == &amp;quot;suspended&amp;quot;)&lt;br /&gt;
 assert(value == 6)&lt;br /&gt;
 &lt;br /&gt;
 -- STEP 14: Run c2 directly, NOT nested inside c1 this time, passing it the value 7.&lt;br /&gt;
 print(14)&lt;br /&gt;
 success, value = coroutine.resume(c2, 7)&lt;br /&gt;
 assert(success)&lt;br /&gt;
 &lt;br /&gt;
 -- c2 should have exited normally, returning the value 8.&lt;br /&gt;
 -- Therefore c1 should still be suspended, but c2 should be dead.&lt;br /&gt;
 -- STEP 17: Check all that.&lt;br /&gt;
 print(17)&lt;br /&gt;
 assert(coroutine.status(c1) == &amp;quot;suspended&amp;quot;)&lt;br /&gt;
 assert(coroutine.status(c2) == &amp;quot;dead&amp;quot;)&lt;br /&gt;
 assert(value == 8)&lt;br /&gt;
&lt;br /&gt;
=== Using Coroutine Wrapper Functions ===&lt;br /&gt;
This second example is virtually identical, but shows using [[coroutine.wrap]] and wrapper functions instead of the basic coroutine functions (checks of [[coroutine.status]] have been removed as the raw coroutine objects are not available):&lt;br /&gt;
&lt;br /&gt;
 -- These variables will hold the coroutine wrapper functions.&lt;br /&gt;
 local cw1 = nil&lt;br /&gt;
 local cw2 = nil&lt;br /&gt;
 &lt;br /&gt;
 -- This function will be the body of the first coroutine.&lt;br /&gt;
 local function f1(x)&lt;br /&gt;
   -- The main code, below, starts c1 first, passing 1.&lt;br /&gt;
   -- Thus c1 should be running, c2 should be suspended (not started yet), and x should receive the value from main, 1.&lt;br /&gt;
   -- STEP 2: Check these assumptions.&lt;br /&gt;
   print(2)&lt;br /&gt;
   assert(x == 1)&lt;br /&gt;
   -- STEP 3: Run c2 until it yields, start it off with the value 2.&lt;br /&gt;
   print(3)&lt;br /&gt;
   value = cw2(2)&lt;br /&gt;
   -- In step 6, c2 yields and passes back the value 3.&lt;br /&gt;
   -- Then c2, having yielded, should be suspended, and c1 should be running again.&lt;br /&gt;
   -- STEP 7: Check all that.&lt;br /&gt;
   print(7)&lt;br /&gt;
   assert(value == 3)&lt;br /&gt;
   -- STEP 8: Run c2 again, passing it the value 4.&lt;br /&gt;
   -- Since c2 has already run before, this time the 4 will come out of the yield() instead of appear as a function parameter.&lt;br /&gt;
   print(8)&lt;br /&gt;
   value = cw2(4)&lt;br /&gt;
   -- In step 10, c2 yields and passes back the value 5.&lt;br /&gt;
   -- Then c2, having yielded, should be suspended, and c1 should be running again.&lt;br /&gt;
   -- STEP 11: Check all that.&lt;br /&gt;
   print(11)&lt;br /&gt;
   assert(value == 5)&lt;br /&gt;
   -- STEP 12: Yield, turning c1 back into a suspended coroutine and continuing execution of the main program, passing back value 6.&lt;br /&gt;
   print(12)&lt;br /&gt;
   value = coroutine.yield(6)&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 -- This function will be the body of the second coroutine.&lt;br /&gt;
 local function f2(x)&lt;br /&gt;
   -- The first time c2 is run, it is run from f1, which passes 2.&lt;br /&gt;
   -- Thus c1 should be normal (as we are nested inside it), c2 should be running, and x should receive the value from f1, 2.&lt;br /&gt;
   -- STEP 4: Check these assumptions.&lt;br /&gt;
   print(4)&lt;br /&gt;
   assert(x == 2)&lt;br /&gt;
   -- Because c1 is not suspended, we should not be able to resume it.&lt;br /&gt;
   -- STEP 5: Check this is correct (we must use pcall because an error will be raised).&lt;br /&gt;
   print(5)&lt;br /&gt;
   success, value = pcall(cw1)&lt;br /&gt;
   assert(not success)&lt;br /&gt;
   -- STEP 6: Yield, turning c2 back into a suspended coroutine and continuing execution of c1, passing back value 3.&lt;br /&gt;
   print(6)&lt;br /&gt;
   value = coroutine.yield(3)&lt;br /&gt;
   -- In step 8, c1 resumed c2 again and passed the value 4.&lt;br /&gt;
   -- c2 should now be running again, and c1 normal again.&lt;br /&gt;
   -- STEP 9: Check all that.&lt;br /&gt;
   print(9)&lt;br /&gt;
   assert(value == 4)&lt;br /&gt;
   -- STEP 10: Yield, turning c2 back into a suspended coroutine and continuing execution of c1, passing back value 5.&lt;br /&gt;
   print(10)&lt;br /&gt;
   value = coroutine.yield(5)&lt;br /&gt;
   -- In step 14, the main program resumed c2 directly and passed the value 7, bypassing c1.&lt;br /&gt;
   -- So c2 should be running and c1 should be suspended.&lt;br /&gt;
   -- STEP 15: Check all that.&lt;br /&gt;
   print(15)&lt;br /&gt;
   assert(value == 7)&lt;br /&gt;
   -- STEP 16: Now die, returning value 8 to the main program.&lt;br /&gt;
   print(16)&lt;br /&gt;
   return 8&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 -- Construct the two coroutine wrappers.&lt;br /&gt;
 cw1 = coroutine.wrap(f1)&lt;br /&gt;
 cw2 = coroutine.wrap(f2)&lt;br /&gt;
 &lt;br /&gt;
 -- STEP 1: Run cw1 until it yields, starting it off with the value 1.&lt;br /&gt;
 print(1)&lt;br /&gt;
 value = cw1(1)&lt;br /&gt;
 &lt;br /&gt;
 -- In step 12, c1 should have yielded and returned the value 6.&lt;br /&gt;
 -- So now c1 and c2 should both be suspended.&lt;br /&gt;
 -- STEP 13: Check all that.&lt;br /&gt;
 print(13)&lt;br /&gt;
 assert(value == 6)&lt;br /&gt;
 &lt;br /&gt;
 -- STEP 14: Run c2 directly, NOT nested inside c1 this time, passing it the value 7.&lt;br /&gt;
 print(14)&lt;br /&gt;
 value = cw2(7)&lt;br /&gt;
 &lt;br /&gt;
 -- c2 should have exited normally, returning the value 8.&lt;br /&gt;
 -- Therefore c1 should still be suspended, but c2 should be dead.&lt;br /&gt;
 -- STEP 17: Check all that.&lt;br /&gt;
 print(17)&lt;br /&gt;
 assert(value == 8)&lt;br /&gt;
&lt;br /&gt;
== Interaction with Other APIs ==&lt;br /&gt;
Raw coroutines are not always safe to use with other API functions. The reason is that [[os.pullEventRaw]] (and therefore [[os.pullEvent]], which calls it) are themselves built using coroutines: &amp;lt;code&amp;gt;os.pullEventRaw&amp;lt;/code&amp;gt; actually invokes [[coroutine.yield]], passing the event type filter up to what it expects is the [[Parallel (API)|parallel API]], which would resume the coroutine once a matching event arrives. This is how the parallel API allows other code to run while one function is blocking waiting for an event. However, it means if you call &amp;lt;code&amp;gt;os.pullEventRaw&amp;lt;/code&amp;gt; ''or any other function that uses it'' while managing coroutines yourself, you will see a coroutine unexpectedly yield, with the parent [[coroutine.resume]] being passed as a return value the filter string passed to &amp;lt;code&amp;gt;os.pullEventRaw&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In this situation, it is essential that a developer carefully audit any APIs (s)he may wish to use to verify whether they could possibly block—many APIs, even those one might not expect, fall into this category. Some examples are:&lt;br /&gt;
* [[rednet.receive]] blocks until either a [[Rednet message (event)|rednet_message event]] or (if a timeout was requested) a matching [[Timer (event)|timer event]] occurs.&lt;br /&gt;
* [[Gps (API)|gps.locate]] blocks until either a number of [[Modem message (event)|modem_message events]] or (if a timeout was requested) a matching [[Timer (event)|timer event]] occurs.&lt;br /&gt;
* [[http.get]] blocks until an [[Http success (event)|HTTP success event]] or [[Http failure (event)|HTTP failure event]] occurs.&lt;br /&gt;
* [[IO (API)|io.read]] and the built-in [[read]] functions block waiting for, presumably, either [[Char (event)|char events]] or [[Key (event)|key events]].&lt;br /&gt;
* [[os.sleep]] blocks until a matching [[Timer (event)|timer event]] occurs.&lt;br /&gt;
* [[textutils.slowPrint]] calls [[os.sleep]].&lt;br /&gt;
* [[textutils.pagedPrint]] blocks until a [[Key (event)|key event]] occurs for each page.&lt;br /&gt;
* Most of the functions in the [[Turtle (API)|turtle API]] (with the exception of [[turtle.getItemCount]], [[turtle.getItemSpace]], and [[turtle.getFuelLevel]]) block waiting for a [[Turtle response (event)|turtle response event]].&lt;br /&gt;
&lt;br /&gt;
Although it is not always practical to do so, in some situations, the [[Parallel (API)|parallel API]] may be preferable to using coroutines directly, as it handles event dispatching properly. However, it does not allow chaining coroutine invocations, nor does it allow adding coroutines to the parallel set after parallel execution has started. If coroutines are to be used directly, an application may either ensure it avoids any blocking API calls, or may arrange to handle event dispatch the same way that the parallel API does so that the blocking functions work properly. For example, one might arrange the convention that the top-level coroutine in the application will call [[os.pullEvent]] and deliver any returned events to sub-coroutines, the same way that the parallel API does, thus allowing those sub-coroutines to themselves call [[os.pullEvent]], while insisting on a convention that more deeply nested coroutines never call [[os.pullEvent]] at all.&lt;br /&gt;
&lt;br /&gt;
[[Category:APIs]]&lt;/div&gt;</summary>
		<author><name>Hawk777</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Fs_(API)&amp;diff=5494</id>
		<title>Fs (API)</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Fs_(API)&amp;diff=5494"/>
				<updated>2013-04-22T19:43:38Z</updated>
		
		<summary type="html">&lt;p&gt;Hawk777: Copy descriptions from function pages, add return column, and use type template&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The FS API allows you to mess around with the filesystem.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table style=&amp;quot;width: 100%; border: solid 1px black; margin: 2px; border-spacing: 0px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td colspan=&amp;quot;3&amp;quot; style=&amp;quot;font-weight: bold; font-size: large; padding-bottom: .3em; border-bottom: solid #C9C9C9 1px; background: #D3FFC2; line-height:28px;&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Grid_disk.png|24px]]&amp;amp;nbsp;&amp;amp;nbsp;&lt;br /&gt;
Fs (API)&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td style=&amp;quot;width: 100px; background: #E0E0E0; padding: .4em; font-weight:bold;&amp;quot;&amp;gt;Return&amp;lt;/td&amp;gt;&amp;lt;td style=&amp;quot;width: 350px; background: #E0E0E0; padding: .4em; font-weight:bold;&amp;quot;&amp;gt;Method Name&amp;lt;/td&amp;gt;&amp;lt;td style=&amp;quot;background: #E0E0E0; padding: .4em; font-weight:bold;&amp;quot;&amp;gt;Description&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #FFFFFF;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;{{Type|table}} files&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[fs.list]]({{Type|string}} path)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Returns a list of all the files (including subdirectories but not their contents) contained in a directory, as a numerically indexed table.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #E8E8E8;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;{{Type|boolean}} exists&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[fs.exists]]({{Type|string}} path)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Checks if a path refers to an existing file or directory.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #FFFFFF;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;{{Type|boolean}} dir&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[fs.isDir]]({{Type|string}} path)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Checks if a path refers to an existing directory.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #E8E8E8;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;{{Type|boolean}} readOnly&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[fs.isReadOnly]]({{Type|string}} path)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Checks if a path is read-only (i.e. cannot be modified).&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #FFFFFF;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;{{Type|string}} name&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[fs.getName]]({{Type|string}} path)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Gets the final component of a pathname.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #E8E8E8;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;{{Type|string}} drive, or [[nil]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[fs.getDrive]]({{Type|string}} path)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Returns the storage medium holding a path, or [[nil]] if the path does not exist.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #FFFFFF;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;{{Type|int}} size&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[fs.getSize]]({{Type|string}} path)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Gets the size of a file in bytes&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #FFFFFF;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;{{Type|int}} space&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[fs.getFreeSpace]]({{Type|string}} path)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Gets the remaining space in the given directory.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #E8E8E8;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[nil]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[fs.makeDir]]({{Type|string}} path)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Makes a directory.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #FFFFFF;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[nil]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[fs.move]]({{Type|string}} fromPath, {{Type|string}} toPath)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Moves a file or directory to a new location.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #E8E8E8;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[nil]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[fs.copy]]({{Type|string}} fromPath, {{Type|string}} toPath)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Copies a file or directory to a new location.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #FFFFFF;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[nil]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[fs.delete]]({{Type|string}} path)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Deletes a file or directory.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #E8E8E8;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;{{Type|string}} path&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[fs.combine]]({{Type|string}} basePath, {{Type|string}} localPath)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Combines two path components, returning a path consisting of the local path nested inside the base path.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #FFFFFF;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;{{Type|table}} handle&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[fs.open]]({{Type|string}} path, {{Type|string}} mode)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Opens a file so it can be read or written.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:APIs]]&lt;br /&gt;
&lt;br /&gt;
==Path Names==&lt;br /&gt;
All of these functions except for [[fs.combine]] refer solely to &amp;lt;em&amp;gt;absolute paths&amp;lt;/em&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;
This means that the current working directory, as set by the &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; command or the [[shell.setDir]] function, is ignored. Each path name consists of a list of nonempty path components separated by forward slashes, and those path components are taken one by one with the first being contained in the root directory of the computer.&lt;br /&gt;
&lt;br /&gt;
If you need to deal with paths provided by the user that may be absolute or may be relative to the current working directory, use [[shell.resolve]].&lt;br /&gt;
&lt;br /&gt;
Unlike most real-world operating systems, ComputerCraft's absolute path name system does not need to be started with a forward slash ( / ), making the directory &amp;quot;a/b/c&amp;quot; the same as &amp;quot;/a/b/c&amp;quot;. Leaving the slashes is just a matter of preference to the coder.&lt;/div&gt;</summary>
		<author><name>Hawk777</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Fs.open&amp;diff=5493</id>
		<title>Fs.open</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Fs.open&amp;diff=5493"/>
				<updated>2013-04-22T19:43:34Z</updated>
		
		<summary type="html">&lt;p&gt;Hawk777: Copy description from API page, change return, and use type template&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase}}&lt;br /&gt;
{{Function&lt;br /&gt;
|name=fs.open&lt;br /&gt;
|args={{Type|string}} path, {{Type|string}} mode&lt;br /&gt;
|api=fs&lt;br /&gt;
|returns={{Type|table}} the file handle, or [[nil]] on error (e.g. if &amp;lt;var&amp;gt;mode&amp;lt;/var&amp;gt; was &amp;quot;r&amp;quot; and the file did not exist, or if &amp;lt;var&amp;gt;mode&amp;lt;/var&amp;gt; was &amp;quot;w&amp;quot; or &amp;quot;a&amp;quot; and the file was in a read-only location)&lt;br /&gt;
|desc=&lt;br /&gt;
'''Supported File Modes'''&lt;br /&gt;
Opens a file so it can be read or written. &amp;lt;var&amp;gt;mode&amp;lt;/var&amp;gt; consists of a first character which is one of the following:&lt;br /&gt;
* &amp;quot;r&amp;quot; to open the file read-only, &lt;br /&gt;
* &amp;quot;w&amp;quot; to open it for writing and remove any existing data on file open, or &lt;br /&gt;
* &amp;quot;a&amp;quot; to open for writing but keep existing data and append any writes to the end of the file&lt;br /&gt;
optionally followed by &amp;quot;b&amp;quot; to open the file for binary access instead of text access &lt;br /&gt;
(text mode will perform end-of-line conversions necessary to move text files between Windows, Linux, and Mac OS systems; binary files should not have these conversions applied as they will be corrupted)&lt;br /&gt;
&lt;br /&gt;
When you have opened a file you must always close the file handle, or else data will not be saved.&lt;br /&gt;
|examples=&lt;br /&gt;
{{Example&lt;br /&gt;
|desc=Creates the file &amp;quot;abcd&amp;quot; for writing, and holds a file handle to it&lt;br /&gt;
|code=h = fs.open(&amp;quot;abcd&amp;quot;, &amp;quot;w&amp;quot;)&lt;br /&gt;
}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== File Handles ==&lt;br /&gt;
&lt;br /&gt;
A file handle allows access to a file. A file handle is a table; the functions within the table are accessed with the dot operator (&amp;lt;em&amp;gt;not&amp;lt;/em&amp;gt; the colon operator, as may be more intuitive!). The examples below assume a file has already been opened and the handle stored in the variable &amp;lt;var&amp;gt;h&amp;lt;/var&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Closing a file handle ===&lt;br /&gt;
&lt;br /&gt;
When you open a file you must remember to then close the handle! With the write modes supported by ComputerCraft all the data that you are writing to a file will not be written into the file until you close the file. A file opened in any mode exposes the following close function.&lt;br /&gt;
{{Function&lt;br /&gt;
|name=&amp;lt;var&amp;gt;h&amp;lt;/var&amp;gt;.close&lt;br /&gt;
|api=fs&lt;br /&gt;
|desc=Closes the file handle, after which it can no longer be used&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Files opened in text read mode ===&lt;br /&gt;
&lt;br /&gt;
A file opened in mode &amp;quot;r&amp;quot; (text read mode) exposes the following functions.&lt;br /&gt;
&lt;br /&gt;
{{Function&lt;br /&gt;
|name=&amp;lt;var&amp;gt;h&amp;lt;/var&amp;gt;.readLine&lt;br /&gt;
|api=fs&lt;br /&gt;
|returns=[[string]] the next line read from the file, with the end-of-line character stripped; or nil if there are no more lines in the file&lt;br /&gt;
|desc=Reads the next line from the file&lt;br /&gt;
}}&lt;br /&gt;
{{Function&lt;br /&gt;
|name=&amp;lt;var&amp;gt;h&amp;lt;/var&amp;gt;.readAll&lt;br /&gt;
|api=fs&lt;br /&gt;
|returns=[[string]] the entire rest of the file, with the end-of-line character on the very last line (if present) stripped&lt;br /&gt;
|desc=Reads the all the text in the file&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Files opened in text write/append mode ===&lt;br /&gt;
&lt;br /&gt;
A file opened in mode &amp;quot;w&amp;quot; (text write mode) or &amp;quot;a&amp;quot; (text append mode) exposes the following functions:&lt;br /&gt;
&lt;br /&gt;
{{Function&lt;br /&gt;
|name=&amp;lt;var&amp;gt;h&amp;lt;/var&amp;gt;.write&lt;br /&gt;
|args=[[string (type)|string]] data&lt;br /&gt;
|api=fs&lt;br /&gt;
|desc=Writes a string of characters to the file exactly as they appear in the string &amp;lt;var&amp;gt;data&amp;lt;/var&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
{{Function&lt;br /&gt;
|name=&amp;lt;var&amp;gt;h&amp;lt;/var&amp;gt;.writeLine&lt;br /&gt;
|args=[[string (type)|string]] data&lt;br /&gt;
|api=fs&lt;br /&gt;
|desc=Writes a string of characters to the file, then appends an end-of-line character&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Files opened in binary read mode ===&lt;br /&gt;
&lt;br /&gt;
A file opened in mode &amp;quot;rb&amp;quot; (binary read mode) exposes the following functions:&lt;br /&gt;
&lt;br /&gt;
{{Function&lt;br /&gt;
|name=&amp;lt;var&amp;gt;h&amp;lt;/var&amp;gt;.read&lt;br /&gt;
|api=fs&lt;br /&gt;
|returns=[[int (type)|int]] the byte read from the file, or [[Nil|nil]] if there are no more bytes&lt;br /&gt;
|desc=Reads a single byte from the file and returns it&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Files opened in binary write/append mode ===&lt;br /&gt;
&lt;br /&gt;
A file opened in mode &amp;quot;wb&amp;quot; (binary write mode) or &amp;quot;ab&amp;quot; (binary append mode) exposes the following functions:&lt;br /&gt;
&lt;br /&gt;
{{Function&lt;br /&gt;
|name=&amp;lt;var&amp;gt;h&amp;lt;/var&amp;gt;.write&lt;br /&gt;
|args=[[int (type)|int]] byte&lt;br /&gt;
|api=fs&lt;br /&gt;
|desc=Writes a single byte into the file&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Lua_Core_Functions]]&lt;/div&gt;</summary>
		<author><name>Hawk777</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Fs.combine&amp;diff=5492</id>
		<title>Fs.combine</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Fs.combine&amp;diff=5492"/>
				<updated>2013-04-22T19:43:32Z</updated>
		
		<summary type="html">&lt;p&gt;Hawk777: Copy description from API page and use type template&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase}}&lt;br /&gt;
{{Function&lt;br /&gt;
|name=fs.combine&lt;br /&gt;
|args={{Type|string}} basePath, {{Type|string}} localPath&lt;br /&gt;
|api=fs&lt;br /&gt;
|returns={{Type|string}} the combined path&lt;br /&gt;
|desc=Combines two path components, returning a path consisting of the local path nested inside the base path. The resultant path consists of all the components of &amp;lt;var&amp;gt;localPath&amp;lt;/var&amp;gt; inside all the components of &amp;lt;var&amp;gt;basePath&amp;lt;/var&amp;gt;. Neither path needs to exist; this function only manipulates strings and does not touch the filesystem.&lt;br /&gt;
|examples=&lt;br /&gt;
{{Example&lt;br /&gt;
|desc=Computes the absolute path to a file called &amp;quot;d&amp;quot; inside a directory called &amp;quot;c&amp;quot;, where &amp;quot;c&amp;quot; is itself inside a directory &amp;quot;b&amp;quot; which is inside a directory &amp;quot;a&amp;quot;&lt;br /&gt;
|code=print(fs.combine(&amp;quot;a/b&amp;quot;, &amp;quot;c/d&amp;quot;))&lt;br /&gt;
|output=a/b/c/d&lt;br /&gt;
}}&lt;br /&gt;
{{Example&lt;br /&gt;
|desc=An empty first path refers to the root directory, so the second path is returned&lt;br /&gt;
|code=print(fs.combine(&amp;quot;&amp;quot;, &amp;quot;c/d&amp;quot;))&lt;br /&gt;
|output=c/d&lt;br /&gt;
}}&lt;br /&gt;
{{Example&lt;br /&gt;
|desc=An empty second path refers to the first path directly, so the first path is returned&lt;br /&gt;
|code=print(fs.combine(&amp;quot;a/b&amp;quot;, &amp;quot;&amp;quot;))&lt;br /&gt;
|output=a/b&lt;br /&gt;
}}&lt;br /&gt;
{{Example&lt;br /&gt;
|desc=The last two examples make sense combined, returning the empty string (referring to the root directory)&lt;br /&gt;
|code=print(fs.combine(&amp;quot;&amp;quot;, &amp;quot;&amp;quot;))&lt;br /&gt;
|output=&lt;br /&gt;
}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Lua_Core_Functions]]&lt;/div&gt;</summary>
		<author><name>Hawk777</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Fs.delete&amp;diff=5491</id>
		<title>Fs.delete</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Fs.delete&amp;diff=5491"/>
				<updated>2013-04-22T19:43:30Z</updated>
		
		<summary type="html">&lt;p&gt;Hawk777: Copy description from API page and use type template&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase}}&lt;br /&gt;
{{Function&lt;br /&gt;
|name=fs.delete&lt;br /&gt;
|args={{Type|string}} path&lt;br /&gt;
|api=fs&lt;br /&gt;
|desc=Deletes a file or directory. A nonexistent target is ignored; a directory is deleted along with all its contents.&lt;br /&gt;
|examples=&lt;br /&gt;
{{Example&lt;br /&gt;
|desc=Deletes a file or directory called &amp;quot;test1&amp;quot; in the root directory&lt;br /&gt;
|code=fs.delete(&amp;quot;test1&amp;quot;)&lt;br /&gt;
}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Lua_Core_Functions]]&lt;/div&gt;</summary>
		<author><name>Hawk777</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Fs.copy&amp;diff=5490</id>
		<title>Fs.copy</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Fs.copy&amp;diff=5490"/>
				<updated>2013-04-22T19:43:28Z</updated>
		
		<summary type="html">&lt;p&gt;Hawk777: Copy description from API page and use type template&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase}}&lt;br /&gt;
{{Function&lt;br /&gt;
|name=fs.copy&lt;br /&gt;
|args={{Type|string}} fromPath, {{Type|string}} toPath&lt;br /&gt;
|api=fs&lt;br /&gt;
|desc=Copies a file or directory to a new location. The parent of the new location must be an existing, writable directory, &amp;lt;var&amp;gt;toPath&amp;lt;/var&amp;gt; must include the target filename and cannot be only a directory to move the file into, and &amp;lt;var&amp;gt;toPath&amp;lt;/var&amp;gt; itself must not already exist.&lt;br /&gt;
|examples=&lt;br /&gt;
{{Example&lt;br /&gt;
|desc=Makes a copy of a file &amp;quot;test1&amp;quot; in the root directory, calling it &amp;quot;test2&amp;quot; and storing the copy in a directory called &amp;quot;mydir&amp;quot;&lt;br /&gt;
|code=fs.copy(&amp;quot;test1&amp;quot;, &amp;quot;mydir/test2&amp;quot;)&lt;br /&gt;
}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Lua_Core_Functions]]&lt;/div&gt;</summary>
		<author><name>Hawk777</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Fs.move&amp;diff=5489</id>
		<title>Fs.move</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Fs.move&amp;diff=5489"/>
				<updated>2013-04-22T19:43:26Z</updated>
		
		<summary type="html">&lt;p&gt;Hawk777: Copy description from API page and use type template&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase}}&lt;br /&gt;
{{Function&lt;br /&gt;
|name=fs.move&lt;br /&gt;
|args={{Type|string}} fromPath, {{Type|string}} toPath&lt;br /&gt;
|api=fs&lt;br /&gt;
|desc=Moves a file or directory to a new location. The parent of the new location must be an existing, writable directory, &amp;lt;var&amp;gt;toPath&amp;lt;/var&amp;gt; must include the target filename and cannot be only a directory to move the file into, and &amp;lt;var&amp;gt;toPath&amp;lt;/var&amp;gt; itself must not already exist.&lt;br /&gt;
|examples=&lt;br /&gt;
{{Example&lt;br /&gt;
|desc=Renames a file from &amp;quot;test1&amp;quot; to &amp;quot;test2&amp;quot; and moves it from the root directory into a directory called &amp;quot;mydir&amp;quot;&lt;br /&gt;
|code=fs.move(&amp;quot;test1&amp;quot;, &amp;quot;mydir/test2&amp;quot;)&lt;br /&gt;
}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Lua_Core_Functions]]&lt;/div&gt;</summary>
		<author><name>Hawk777</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Fs.makeDir&amp;diff=5488</id>
		<title>Fs.makeDir</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Fs.makeDir&amp;diff=5488"/>
				<updated>2013-04-22T19:43:24Z</updated>
		
		<summary type="html">&lt;p&gt;Hawk777: Copy description from API page and use type template&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase}}&lt;br /&gt;
{{Function&lt;br /&gt;
|name=fs.makeDir&lt;br /&gt;
|args={{Type|string}} path&lt;br /&gt;
|api=fs&lt;br /&gt;
|desc=Makes a directory. If the location is already a directory, this function silently does nothing. If any parent path components are missing, they are also created. If the target location or any parent exists and is a file (instead of a directory), the operation fails.&lt;br /&gt;
|examples=&lt;br /&gt;
{{Example&lt;br /&gt;
|desc=Create a directory called &amp;quot;efgh&amp;quot; inside a directory called &amp;quot;abcd&amp;quot; (&amp;quot;abcd&amp;quot; need not exist; it will be created)&lt;br /&gt;
|code=fs.makeDir(&amp;quot;abcd/efgh&amp;quot;)&lt;br /&gt;
}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Lua_Core_Functions]]&lt;/div&gt;</summary>
		<author><name>Hawk777</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Fs.getFreeSpace&amp;diff=5487</id>
		<title>Fs.getFreeSpace</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Fs.getFreeSpace&amp;diff=5487"/>
				<updated>2013-04-22T19:43:22Z</updated>
		
		<summary type="html">&lt;p&gt;Hawk777: Copy description from API page, clean up return, and use type template&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase}}&lt;br /&gt;
{{Function&lt;br /&gt;
|name=fs.getFreeSpace&lt;br /&gt;
|args={{Type|string}} path&lt;br /&gt;
|api=fs&lt;br /&gt;
|returns={{Type|int}} free space in bytes&lt;br /&gt;
|desc=Gets the remaining space in the given directory. The directory may refer to the computer’s local hard drive or to a floppy disk.&lt;br /&gt;
|examples=&lt;br /&gt;
{{Example&lt;br /&gt;
|desc=Computes the amount of free space on the computer&lt;br /&gt;
|code=print(tostring(fs.getFreeSpace(&amp;quot;/&amp;quot;)))&lt;br /&gt;
|output=10(can be different)&lt;br /&gt;
}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Lua_Core_Functions]]&lt;/div&gt;</summary>
		<author><name>Hawk777</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Fs.getSize&amp;diff=5486</id>
		<title>Fs.getSize</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Fs.getSize&amp;diff=5486"/>
				<updated>2013-04-22T19:43:20Z</updated>
		
		<summary type="html">&lt;p&gt;Hawk777: Change description and use type template&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase}}&lt;br /&gt;
{{Function&lt;br /&gt;
|name=fs.getSize&lt;br /&gt;
|args={{Type|string}} path&lt;br /&gt;
|returns={{Type|int}} size in bytes&lt;br /&gt;
|api=fs&lt;br /&gt;
|desc=Gets the size of a file in bytes. This is not actually the exactly length of the file in bytes; rather, it is the amount that the file contributes towards the computer’s or disk’s storage quota. This is either 512 bytes or the actual length of the file plus the length of its name, whichever is larger.[http://www.computercraft.info/forums2/index.php?/topic/12243-152fsgetsize-returns-unexpected-values/]&lt;br /&gt;
|examples=&lt;br /&gt;
{{Example&lt;br /&gt;
|desc=Get the size of the shell from the ROM and print it&lt;br /&gt;
|code=print( fs.getSize(&amp;quot;/rom/programs/shell&amp;quot;) )&lt;br /&gt;
}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Lua_Core_Functions]]&lt;/div&gt;</summary>
		<author><name>Hawk777</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Fs.getDrive&amp;diff=5485</id>
		<title>Fs.getDrive</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Fs.getDrive&amp;diff=5485"/>
				<updated>2013-04-22T19:43:18Z</updated>
		
		<summary type="html">&lt;p&gt;Hawk777: Use type template&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase}}&lt;br /&gt;
{{Function&lt;br /&gt;
|name=fs.getDrive&lt;br /&gt;
|args={{Type|string}} path&lt;br /&gt;
|api=fs&lt;br /&gt;
|returns={{Type|string}} the type of storage medium holding the path, or [[nil]] if the path does not exist&lt;br /&gt;
|desc=Returns the storage medium holding a path, or [[nil]] if the path does not exist. This is one of “hdd” if the path is stored on the computer’s local hard drive, “rom” if the path is in ROM, or the side on which a disk drive is attached if the path is on a [[Floppy Disk]]. As of ComputerCraft 1.52, a network-attached disk drive with a floppy in it returns the side of the computer on which the modem is attached, rather than the network name of the disk drive; presumably this is a bug.[http://www.computercraft.info/forums2/index.php?/topic/12369-mc-151-cc-152-fsgetdrive-wrong-answer-for-network-drives/]&lt;br /&gt;
|examples=&lt;br /&gt;
{{Example&lt;br /&gt;
|desc=Checks that the standard &amp;quot;startup&amp;quot; file is stored in ROM&lt;br /&gt;
|code=print(fs.getDrive(&amp;quot;rom/startup&amp;quot;))&lt;br /&gt;
|output=rom&lt;br /&gt;
}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Lua_Core_Functions]]&lt;/div&gt;</summary>
		<author><name>Hawk777</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Fs.exists&amp;diff=5484</id>
		<title>Fs.exists</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Fs.exists&amp;diff=5484"/>
				<updated>2013-04-22T19:43:15Z</updated>
		
		<summary type="html">&lt;p&gt;Hawk777: Copy description from API page, fix return styling, and use type template&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase}}&lt;br /&gt;
{{Function&lt;br /&gt;
|name=fs.exists&lt;br /&gt;
|args={{Type|string}} path&lt;br /&gt;
|api=fs&lt;br /&gt;
|returns={{Type|boolean}} &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if &amp;lt;var&amp;gt;path&amp;lt;/var&amp;gt; is an existing file or directory, or &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; if not&lt;br /&gt;
|desc=Checks if a path refers to an existing file or directory.&lt;br /&gt;
|examples=&lt;br /&gt;
{{Example&lt;br /&gt;
|desc=Checks that the &amp;quot;rom&amp;quot; directory exists&lt;br /&gt;
|code=print(fs.exists(&amp;quot;rom&amp;quot;))&lt;br /&gt;
|output=true&lt;br /&gt;
}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Lua_Core_Functions]]&lt;/div&gt;</summary>
		<author><name>Hawk777</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Fs.list&amp;diff=5483</id>
		<title>Fs.list</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Fs.list&amp;diff=5483"/>
				<updated>2013-04-22T19:43:14Z</updated>
		
		<summary type="html">&lt;p&gt;Hawk777: Update description to correct semantics for non-directories and use type template&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase}}&lt;br /&gt;
{{Function&lt;br /&gt;
|name=fs.list&lt;br /&gt;
|args={{Type|string}} path&lt;br /&gt;
|api=fs&lt;br /&gt;
|returns={{Type|table}} list of files and folders in &amp;lt;var&amp;gt;path&amp;lt;/var&amp;gt;. If &amp;lt;var&amp;gt;path&amp;lt;/var&amp;gt; is not a directory, an empty table is returned.&lt;br /&gt;
|desc=Returns a list of all the files (including subdirectories but not their contents) contained in a directory, as a numerically indexed table.&lt;br /&gt;
|examples=&lt;br /&gt;
{{Example&lt;br /&gt;
|desc=Displays a list of all files and folders in the root directory of a computer&lt;br /&gt;
|code=local FileList = fs.list(&amp;quot;&amp;quot;) --Table with all the files and directories available&lt;br /&gt;
 &lt;br /&gt;
 for _, file in ipairs(FileList) do --Loop. Underscore because we don't use the key, ipairs so it's in order&lt;br /&gt;
   print(file) --Print the file name&lt;br /&gt;
 end --End the loop&lt;br /&gt;
&lt;br /&gt;
|output=A list of all files and folders in the root directory as a table. Note that fs.list() could also be inserted directly into ipairs() or pairs().&lt;br /&gt;
}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Lua_Core_Functions]]&lt;/div&gt;</summary>
		<author><name>Hawk777</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Fs.isDir&amp;diff=5482</id>
		<title>Fs.isDir</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Fs.isDir&amp;diff=5482"/>
				<updated>2013-04-22T19:43:12Z</updated>
		
		<summary type="html">&lt;p&gt;Hawk777: Copy description from API page, fix return formatting, and use type template&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase}}&lt;br /&gt;
{{Function&lt;br /&gt;
|name=fs.isDir&lt;br /&gt;
|args={{Type|string}} path&lt;br /&gt;
|api=fs&lt;br /&gt;
|returns={{Type|boolean}} &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if &amp;lt;var&amp;gt;path&amp;lt;/var&amp;gt; is an existing directory, or &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; if not (if it doesn't exist or if it is a regular file)&lt;br /&gt;
|desc=Checks if a path refers to an existing directory.&lt;br /&gt;
|examples=&lt;br /&gt;
{{Example&lt;br /&gt;
|desc=Checks that the &amp;quot;rom&amp;quot; directory is, in fact, a directory&lt;br /&gt;
|code=print(fs.isDir(&amp;quot;rom&amp;quot;))&lt;br /&gt;
|output=true&lt;br /&gt;
}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Lua_Core_Functions]]&lt;/div&gt;</summary>
		<author><name>Hawk777</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Fs.isReadOnly&amp;diff=5481</id>
		<title>Fs.isReadOnly</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Fs.isReadOnly&amp;diff=5481"/>
				<updated>2013-04-22T19:43:10Z</updated>
		
		<summary type="html">&lt;p&gt;Hawk777: Copy description from API page, fix return formatting, and use type template&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase}}&lt;br /&gt;
{{Function&lt;br /&gt;
|name=fs.isReadOnly&lt;br /&gt;
|args={{Type|string}} path&lt;br /&gt;
|api=fs&lt;br /&gt;
|returns={{Type|boolean}} &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; if &amp;lt;var&amp;gt;path&amp;lt;/var&amp;gt; can be written to, or &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if not&lt;br /&gt;
|desc=Checks if a path is read-only (i.e. cannot be modified). The path need not exist in order to perform this test. Note that the root directory and the mount points of any floppy disks are considered read-only, perhaps because they cannot ''themselves'' be modified, only their ''contents'' can be.&lt;br /&gt;
|examples=&lt;br /&gt;
{{Example&lt;br /&gt;
|desc=Checks that the &amp;quot;rom&amp;quot; directory is read-only, as its name implies&lt;br /&gt;
|code=print(fs.isReadOnly(&amp;quot;rom&amp;quot;))&lt;br /&gt;
|output=true&lt;br /&gt;
}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Lua_Core_Functions]]&lt;/div&gt;</summary>
		<author><name>Hawk777</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Fs.getName&amp;diff=5480</id>
		<title>Fs.getName</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Fs.getName&amp;diff=5480"/>
				<updated>2013-04-22T19:43:06Z</updated>
		
		<summary type="html">&lt;p&gt;Hawk777: Copy description from API page and use type template&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase}}&lt;br /&gt;
{{Function&lt;br /&gt;
|name=fs.getName&lt;br /&gt;
|args={{Type|string}} path&lt;br /&gt;
|api=fs&lt;br /&gt;
|returns={{Type|string}} the last path component of the path, or &amp;quot;root&amp;quot; if the path refers to the root directory&lt;br /&gt;
|desc=Gets the final component of a pathname. Pathname components are separated by forward slashes. The path need not exist.&lt;br /&gt;
|examples=&lt;br /&gt;
{{Example&lt;br /&gt;
|desc=Gets the last path component of a file&lt;br /&gt;
|code=print(fs.getName(&amp;quot;rom/apis/colors&amp;quot;))&lt;br /&gt;
|output=colors&lt;br /&gt;
}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Lua_Core_Functions]]&lt;/div&gt;</summary>
		<author><name>Hawk777</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Fs.list&amp;diff=5479</id>
		<title>Fs.list</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Fs.list&amp;diff=5479"/>
				<updated>2013-04-22T19:18:47Z</updated>
		
		<summary type="html">&lt;p&gt;Hawk777: Clarify that subdirectories’ contents are not returned&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase}}&lt;br /&gt;
{{Function&lt;br /&gt;
|name=fs.list&lt;br /&gt;
|args=[[string (type)|string]] path&lt;br /&gt;
|api=fs&lt;br /&gt;
|returns=[[table (type)|table]] list of files and folders in &amp;lt;var&amp;gt;path&amp;lt;/var&amp;gt;, which must be a directory&lt;br /&gt;
|desc=Returns a list of all the files (including subdirectories but not their contents) contained in a directory, as a numerically indexed table.&lt;br /&gt;
|examples=&lt;br /&gt;
{{Example&lt;br /&gt;
|desc=Displays a list of all files and folders in the root directory of a computer&lt;br /&gt;
|code=local FileList = fs.list(&amp;quot;&amp;quot;) --Table with all the files and directories available&lt;br /&gt;
 &lt;br /&gt;
 for _, file in ipairs(FileList) do --Loop. Underscore because we don't use the key, ipairs so it's in order&lt;br /&gt;
   print(file) --Print the file name&lt;br /&gt;
 end --End the loop&lt;br /&gt;
&lt;br /&gt;
|output=A list of all files and folders in the root directory as a table. Note that fs.list() could also be inserted directly into ipairs() or pairs().&lt;br /&gt;
}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Lua_Core_Functions]]&lt;/div&gt;</summary>
		<author><name>Hawk777</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Disk.hasData&amp;diff=5478</id>
		<title>Disk.hasData</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Disk.hasData&amp;diff=5478"/>
				<updated>2013-04-22T19:12:56Z</updated>
		
		<summary type="html">&lt;p&gt;Hawk777: Use type template&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase}}&lt;br /&gt;
{{Function&lt;br /&gt;
|name=disk.hasData&lt;br /&gt;
|args={{Type|string}} side&lt;br /&gt;
|api=disk&lt;br /&gt;
|returns={{Type|boolean}} whether the item is a floppy&lt;br /&gt;
|desc=Checks whether the current disk is a [[Floppy Disk|floppy disk]], as opposed to a [http://www.minecraftwiki.net/wiki/Music_Discs music disc] or other item.&lt;br /&gt;
|addon=ComputerCraft&lt;br /&gt;
|examples=&lt;br /&gt;
{{Example&lt;br /&gt;
|desc=Checks for what is in the bottom drive&lt;br /&gt;
|code=print(disk.hasData(&amp;quot;bottom&amp;quot;))&lt;br /&gt;
|output=true if the item is a floppy, otherwise false&lt;br /&gt;
}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:API_Functions]]&lt;/div&gt;</summary>
		<author><name>Hawk777</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Disk.isPresent&amp;diff=5477</id>
		<title>Disk.isPresent</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Disk.isPresent&amp;diff=5477"/>
				<updated>2013-04-22T19:12:54Z</updated>
		
		<summary type="html">&lt;p&gt;Hawk777: Use type template&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase}}&lt;br /&gt;
{{Function&lt;br /&gt;
|name=disk.isPresent&lt;br /&gt;
|args={{Type|string}} side&lt;br /&gt;
|api=disk&lt;br /&gt;
|returns={{Type|boolean}} something is in the disk drive&lt;br /&gt;
|addon=ComputerCraft&lt;br /&gt;
|desc=Checks whether any item at all is in the disk drive.&lt;br /&gt;
|examples=&lt;br /&gt;
{{Example&lt;br /&gt;
|desc=Checks whether something is in the bottom disk drive or not&lt;br /&gt;
|code=print(disk.isPresent(&amp;quot;bottom&amp;quot;))&lt;br /&gt;
|output=true if there is an item, otherwise false&lt;br /&gt;
}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:API_Functions]]&lt;/div&gt;</summary>
		<author><name>Hawk777</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Disk.getMountPath&amp;diff=5476</id>
		<title>Disk.getMountPath</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Disk.getMountPath&amp;diff=5476"/>
				<updated>2013-04-22T19:12:52Z</updated>
		
		<summary type="html">&lt;p&gt;Hawk777: Use type template&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase}}&lt;br /&gt;
{{Function&lt;br /&gt;
|name=disk.getMountPath&lt;br /&gt;
|args={{Type|string}} side&lt;br /&gt;
|api=disk&lt;br /&gt;
|returns={{Type|string}} path, or [[nil]] if the drive does not contain a floppy&lt;br /&gt;
|desc=Finds the directory name on the local computer where the contents of the [[Floppy Disk]] currently inserted in the drive can be found.&lt;br /&gt;
|addon=ComputerCraft&lt;br /&gt;
|examples=&lt;br /&gt;
{{Example&lt;br /&gt;
|desc=Finds the path of the bottom disk drive&lt;br /&gt;
|code=print(disk.getMountPath(&amp;quot;bottom&amp;quot;))&lt;br /&gt;
|output=disk&lt;br /&gt;
}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:API_Functions]]&lt;/div&gt;</summary>
		<author><name>Hawk777</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Disk.setLabel&amp;diff=5475</id>
		<title>Disk.setLabel</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Disk.setLabel&amp;diff=5475"/>
				<updated>2013-04-22T19:12:51Z</updated>
		
		<summary type="html">&lt;p&gt;Hawk777: Use type template&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase}}&lt;br /&gt;
{{Function&lt;br /&gt;
|name=disk.setLabel&lt;br /&gt;
|args={{Type|string}} side, {{Type|string}} label&lt;br /&gt;
|api=disk&lt;br /&gt;
|addon=ComputerCraft&lt;br /&gt;
|desc=Writes a label to the floppy disk, which can be read with [[disk.getLabel]] and viewed in the item tooltip.&lt;br /&gt;
|examples=&lt;br /&gt;
{{Example&lt;br /&gt;
|desc=Sets the label of the disk in the bottom drive to &amp;quot;Floppy&amp;quot;&lt;br /&gt;
|code=disk.setLabel(&amp;quot;bottom&amp;quot;, &amp;quot;Floppy&amp;quot;)&lt;br /&gt;
}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:API_Functions]]&lt;/div&gt;</summary>
		<author><name>Hawk777</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Disk.getLabel&amp;diff=5474</id>
		<title>Disk.getLabel</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Disk.getLabel&amp;diff=5474"/>
				<updated>2013-04-22T19:12:49Z</updated>
		
		<summary type="html">&lt;p&gt;Hawk777: Use type template&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase}}&lt;br /&gt;
{{Function&lt;br /&gt;
|name=disk.getLabel&lt;br /&gt;
|args={{Type|string}} side&lt;br /&gt;
|api=disk&lt;br /&gt;
|returns={{Type|string}} disk label, or [[nil]] if the item in the drive is neither a floppy disk nor a music record or if it is a floppy disk with no label&lt;br /&gt;
|addon=ComputerCraft&lt;br /&gt;
|desc=Reads the label from the disk in the drive. This is the label that shows up in the item tooltip (for both [[Floppy Disk|floppy disks]] and music records). For floppy disks, the label can be set with [[disk.setLabel]].&lt;br /&gt;
|examples=&lt;br /&gt;
{{Example&lt;br /&gt;
|desc=Checks for data saved on the disk in the bottom drive&lt;br /&gt;
|code=print(disk.getLabel(&amp;quot;bottom&amp;quot;))&lt;br /&gt;
|output=Floppy --'''Output changes according to the disk label'''&lt;br /&gt;
}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:API_Functions]]&lt;/div&gt;</summary>
		<author><name>Hawk777</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Disk.getID&amp;diff=5473</id>
		<title>Disk.getID</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Disk.getID&amp;diff=5473"/>
				<updated>2013-04-22T19:12:47Z</updated>
		
		<summary type="html">&lt;p&gt;Hawk777: Use type template&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase}}&lt;br /&gt;
{{Function&lt;br /&gt;
|name=disk.getID&lt;br /&gt;
|args={{Type|string}} side&lt;br /&gt;
|api=disk&lt;br /&gt;
|returns={{Type|int}} the disk ID, or [[nil]] if the drive does not contain a [[Floppy Disk]]&lt;br /&gt;
|addon=ComputerCraft&lt;br /&gt;
|desc=Returns a number which uniquely identifies the disk in the drive and which is the name of the directory in the world’s &amp;lt;code&amp;gt;computer/disk&amp;lt;/code&amp;gt; directory containing the disk’s data.&lt;br /&gt;
|examples=&lt;br /&gt;
{{Example&lt;br /&gt;
|desc=Prints the ID of the disk.&lt;br /&gt;
|code=print(disk.getID(&amp;quot;bottom&amp;quot;))&lt;br /&gt;
|output=The ID of the disk (side varies).&lt;br /&gt;
}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:API_Functions]]&lt;/div&gt;</summary>
		<author><name>Hawk777</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Disk.hasAudio&amp;diff=5472</id>
		<title>Disk.hasAudio</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Disk.hasAudio&amp;diff=5472"/>
				<updated>2013-04-22T19:12:46Z</updated>
		
		<summary type="html">&lt;p&gt;Hawk777: Use type template&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase}}&lt;br /&gt;
{{Function&lt;br /&gt;
|name=disk.hasAudio&lt;br /&gt;
|args={{Type|string}} side&lt;br /&gt;
|api=disk&lt;br /&gt;
|returns={{Type|boolean}} whether there is audio saved on the disk&lt;br /&gt;
|addon=ComputerCraft&lt;br /&gt;
|desc=Checks whether the current disk is a [http://www.minecraftwiki.net/wiki/Music_Discs music disk], as opposed to a [[Floppy Disk|floppy disk]] or other item.&lt;br /&gt;
|examples=&lt;br /&gt;
{{Example&lt;br /&gt;
|desc=Checks for audio saved on the disk in the bottom drive&lt;br /&gt;
|code=print(disk.hasAudio(&amp;quot;bottom&amp;quot;))&lt;br /&gt;
|output=true if there is audio, otherwise false&lt;br /&gt;
}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:API_Functions]]&lt;/div&gt;</summary>
		<author><name>Hawk777</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Disk.getAudioTitle&amp;diff=5471</id>
		<title>Disk.getAudioTitle</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Disk.getAudioTitle&amp;diff=5471"/>
				<updated>2013-04-22T19:12:44Z</updated>
		
		<summary type="html">&lt;p&gt;Hawk777: Use type template&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase}}&lt;br /&gt;
{{Function&lt;br /&gt;
|name=disk.getAudioTitle&lt;br /&gt;
|args={{Type|string}} side&lt;br /&gt;
|api=disk&lt;br /&gt;
|returns={{Type|string}} the track title, or [[nil]] if there is not a music record in the drive&lt;br /&gt;
|addon=ComputerCraft&lt;br /&gt;
|desc=Reads the title of the audio track from the music record in the drive. The [[disk.getLabel]] function also returns the track title of a music record.&lt;br /&gt;
|examples=&lt;br /&gt;
{{Example&lt;br /&gt;
|desc=Returns the title of an audio disk&lt;br /&gt;
|code=print(disk.getAudioTitle(&amp;quot;bottom&amp;quot;))&lt;br /&gt;
|output=C418 - ward '''Output changes according to the audio title'''&lt;br /&gt;
}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:API_Functions]]&lt;/div&gt;</summary>
		<author><name>Hawk777</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Disk.playAudio&amp;diff=5470</id>
		<title>Disk.playAudio</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Disk.playAudio&amp;diff=5470"/>
				<updated>2013-04-22T19:12:43Z</updated>
		
		<summary type="html">&lt;p&gt;Hawk777: Use type template&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase}}&lt;br /&gt;
{{Function&lt;br /&gt;
|name=disk.playAudio&lt;br /&gt;
|args={{Type|string}} side&lt;br /&gt;
|api=disk&lt;br /&gt;
|addon=ComputerCraft&lt;br /&gt;
|desc=Starts playing the music record in the drive. If any record is already playing on any disk drive, it stops before the target drive starts playing. The record stops when it reaches the end of the track, when it is removed from the drive, when [[disk.stopAudio]] is called, or when another record is started.&lt;br /&gt;
|examples=&lt;br /&gt;
{{Example&lt;br /&gt;
|desc=Plays the audio found on the disk on the bottom drive (if any)&lt;br /&gt;
|code=disk.playAudio(&amp;quot;bottom&amp;quot;)&lt;br /&gt;
}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:API_Functions]]&lt;/div&gt;</summary>
		<author><name>Hawk777</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Disk.stopAudio&amp;diff=5469</id>
		<title>Disk.stopAudio</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Disk.stopAudio&amp;diff=5469"/>
				<updated>2013-04-22T19:12:41Z</updated>
		
		<summary type="html">&lt;p&gt;Hawk777: Use type template&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase}}&lt;br /&gt;
{{Function&lt;br /&gt;
|name=disk.stopAudio&lt;br /&gt;
|args={{Type|string}} side&lt;br /&gt;
|api=disk&lt;br /&gt;
|addon=ComputerCraft&lt;br /&gt;
|desc=Stops the music record in the drive from playing, if it was started with [[disk.playAudio]].&lt;br /&gt;
|examples=&lt;br /&gt;
{{Example&lt;br /&gt;
|desc=Stops the audio playing on the disk on the bottom drive (if any)&lt;br /&gt;
|code=disk.stopAudio(&amp;quot;bottom&amp;quot;)&lt;br /&gt;
}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:API_Functions]]&lt;/div&gt;</summary>
		<author><name>Hawk777</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Disk.eject&amp;diff=5468</id>
		<title>Disk.eject</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Disk.eject&amp;diff=5468"/>
				<updated>2013-04-22T19:12:39Z</updated>
		
		<summary type="html">&lt;p&gt;Hawk777: Use type template&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase}}&lt;br /&gt;
{{Function&lt;br /&gt;
|name=disk.eject&lt;br /&gt;
|args={{Type|string}} side&lt;br /&gt;
|api=disk&lt;br /&gt;
|addon=ComputerCraft&lt;br /&gt;
|desc=Ejects any item currently in the drive, spilling it into the world as a loose item.&lt;br /&gt;
|examples=&lt;br /&gt;
{{Example&lt;br /&gt;
|desc=Ejects the disk in the bottom drive&lt;br /&gt;
|code=disk.eject(&amp;quot;bottom&amp;quot;)&lt;br /&gt;
}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:API_Functions]]&lt;/div&gt;</summary>
		<author><name>Hawk777</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Disk_(API)&amp;diff=5467</id>
		<title>Disk (API)</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Disk_(API)&amp;diff=5467"/>
				<updated>2013-04-22T19:08:32Z</updated>
		
		<summary type="html">&lt;p&gt;Hawk777: Fix template transclusion&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''If you were looking for the item, please see [[Floppy Disk]].''&lt;br /&gt;
&lt;br /&gt;
The Disk API allows you to interact with disk drives. These functions can operate on locally attached or remote disk drives. To use a locally attached drive, specify “side” as one of the six sides (e.g. “left”); to use a remote disk drive, specify its name as printed when enabling its modem (e.g. “drive_0”).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table style=&amp;quot;width: 100%; border: solid 1px black; margin: 2px; border-spacing: 0px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td colspan=&amp;quot;3&amp;quot; style=&amp;quot;font-weight: bold; font-size: large; padding-bottom: .3em; border-bottom: solid #C9C9C9 1px; background: #D3FFC2; line-height:28px;&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Grid_disk.png|24px]]&amp;amp;nbsp;&amp;amp;nbsp;&lt;br /&gt;
Disk (API)&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td style=&amp;quot;width: 100px; background: #E0E0E0; padding: .4em; font-weight:bold;&amp;quot;&amp;gt;Return&amp;lt;/td&amp;gt;&amp;lt;td style=&amp;quot;width: 350px; background: #E0E0E0; padding: .4em; font-weight:bold;&amp;quot;&amp;gt;Method Name&amp;lt;/td&amp;gt;&amp;lt;td style=&amp;quot;background: #E0E0E0; padding: .4em; font-weight:bold;&amp;quot;&amp;gt;Description&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #FFFFFF;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;{{Type|boolean}} present&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[disk.isPresent|disk.isPresent]]({{Type|string}} side)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Checks whether any item at all is in the disk drive.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #E8E8E8;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;{{Type|boolean}} disk&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[disk.hasData|disk.hasData]]({{Type|string}} side)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Checks whether the current disk is a [[Floppy Disk|floppy disk]], as opposed to a [http://www.minecraftwiki.net/wiki/Music_Discs music disc] or other item.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #FFFFFF;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;{{Type|string}} path, or [[nil]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[disk.getMountPath|disk.getMountPath]]({{Type|string}} side)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Finds the directory name on the local computer where the contents of the Floppy Disk currently inserted in the drive can be found.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #E8E8E8;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[nil]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[disk.setLabel|disk.setLabel]]({{Type|string}} side, {{Type|string}} label)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Writes a label to the floppy disk, which can be read with [[disk.getLabel]] and viewed in the item tooltip.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #FFFFFF;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;{{Type|string}} label&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[disk.getLabel|disk.getLabel]]({{Type|string}} side)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Reads the label from the disk in the drive.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #E8E8E8;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;{{Type|int}} id&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[disk.getID|disk.getID]]({{Type|string}} side)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Returns a number which uniquely identifies the disk in the drive and which is the name of the directory in the world’s &amp;lt;code&amp;gt;computer/disk&amp;lt;/code&amp;gt; directory containing the disk’s data.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #FFFFFF;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;{{Type|boolean}} audio&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[disk.hasAudio|disk.hasAudio]]({{Type|string}} side)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Checks whether the current disk is a [http://www.minecraftwiki.net/wiki/Music_Discs music disk], as opposed to a [[Floppy Disk|floppy disk]] or other item.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #E8E8E8;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;{{Type|string}} title&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[disk.getAudioTitle|disk.getAudioTitle]]({{Type|string}} side)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Reads the title of the audio track from the music record in the drive.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #FFFFFF;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[nil]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[disk.playAudio|disk.playAudio]]({{Type|string}} side)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Starts playing the music record in the drive.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #E8E8E8;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[nil]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[disk.stopAudio|disk.stopAudio]]({{Type|string}} side)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Stops the music record in the drive from playing, if it was started with [[disk.playAudio]].&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #FFFFFF;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[nil]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[disk.eject|disk.eject]]({{Type|string}} side)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Ejects any item currently in the drive, spilling it into the world as a loose item.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:APIs]]&lt;br /&gt;
/td&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hawk777</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Disk.hasAudio&amp;diff=5466</id>
		<title>Disk.hasAudio</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Disk.hasAudio&amp;diff=5466"/>
				<updated>2013-04-22T19:07:59Z</updated>
		
		<summary type="html">&lt;p&gt;Hawk777: Take better description from function table on API page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase}}&lt;br /&gt;
{{Function&lt;br /&gt;
|name=disk.hasAudio&lt;br /&gt;
|args=[[string (type)|string]] side&lt;br /&gt;
|api=disk&lt;br /&gt;
|returns=[[boolean_(type)|boolean]] whether there is audio saved on the disk&lt;br /&gt;
|addon=ComputerCraft&lt;br /&gt;
|desc=Checks whether the current disk is a [http://www.minecraftwiki.net/wiki/Music_Discs music disk], as opposed to a [[Floppy Disk|floppy disk]] or other item.&lt;br /&gt;
|examples=&lt;br /&gt;
{{Example&lt;br /&gt;
|desc=Checks for audio saved on the disk in the bottom drive&lt;br /&gt;
|code=print(disk.hasAudio(&amp;quot;bottom&amp;quot;))&lt;br /&gt;
|output=true if there is audio, otherwise false&lt;br /&gt;
}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:API_Functions]]&lt;/div&gt;</summary>
		<author><name>Hawk777</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Disk.hasData&amp;diff=5465</id>
		<title>Disk.hasData</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Disk.hasData&amp;diff=5465"/>
				<updated>2013-04-22T19:07:54Z</updated>
		
		<summary type="html">&lt;p&gt;Hawk777: Take better description from function table on API page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase}}&lt;br /&gt;
{{Function&lt;br /&gt;
|name=disk.hasData&lt;br /&gt;
|args=[[string (type)|string]] side&lt;br /&gt;
|api=disk&lt;br /&gt;
|returns=[[boolean_(type)|boolean]] whether the item is a floppy&lt;br /&gt;
|desc=Checks whether the current disk is a [[Floppy Disk|floppy disk]], as opposed to a [http://www.minecraftwiki.net/wiki/Music_Discs music disc] or other item.&lt;br /&gt;
|addon=ComputerCraft&lt;br /&gt;
|examples=&lt;br /&gt;
{{Example&lt;br /&gt;
|desc=Checks for what is in the bottom drive&lt;br /&gt;
|code=print(disk.hasData(&amp;quot;bottom&amp;quot;))&lt;br /&gt;
|output=true if the item is a floppy, otherwise false&lt;br /&gt;
}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:API_Functions]]&lt;/div&gt;</summary>
		<author><name>Hawk777</name></author>	</entry>

	</feed>