Difference between revisions of "IO (API)"

From ComputerCraft Wiki
Jump to: navigation, search
(added some new non-working features)
(Update list of non-working features)
Line 1: Line 1:
 
IO is a reimplementation of the default Lua input / output API defined [http://www.lua.org/manual/5.1/manual.html#5.7 here], with some features trimmed. Most features should work. If you find a non-working feature, please list it here.
 
IO is a reimplementation of the default Lua input / output API defined [http://www.lua.org/manual/5.1/manual.html#5.7 here], with some features trimmed. Most features should work. If you find a non-working feature, please list it here.
  
List of non-working features from IO:
+
List of non-working features from IO as of ComputerCraft 1.52:
  
* file:seek(...) - Doesn't exist.
+
* io.close: Doesn’t exist.
* io.lines(...) - Doesn't exist either.
+
* io.flush: Doesn’t exist.
* io.read("*all") - read() does not work with "*all" argument; use "*a" instead.
+
* io.input: Doesn’t exist.
* io.open("FILE_NAME", "a+") - Append+ mode is unsupported.
+
* io.lines: Doesn't exist.
* io.open("FILE_NAME", "w+") - Write+ mode is unsupported.
+
* io.open: Modes “a+”, “r+”, and “w+” are not supported.
* io.open("FILE_NAME", "r+") - Read+ mode is unsupported.
+
* io.output: Doesn’t exist.
* file:read(...) - Doesn't seem to exist in 1.43.
+
* io.popen: Doesn’t exist.
* file:read(number) - Doesn't exist as of 1.46.
+
* io.read: Only allows format string “*l”.
 +
* io.tmpfile: Doesn’t exist.
 +
* file:read: Doesn’t support format string “*n” or a character count.
 +
* file:seek: Doesn’t exist.
 +
* file:setvbuf: Doesn’t exist.
  
If any functions don't exist try the [[Fs (API)|Fs]] API instead.
+
All of the capabilities in this API are also available in the [[Fs (API)|Fs API]], along with some other functions not directly related to reading and writing individual files.
 
[[Category:APIs]]
 
[[Category:APIs]]

Revision as of 19:33, 21 April 2013

IO is a reimplementation of the default Lua input / output API defined here, with some features trimmed. Most features should work. If you find a non-working feature, please list it here.

List of non-working features from IO as of ComputerCraft 1.52:

  • io.close: Doesn’t exist.
  • io.flush: Doesn’t exist.
  • io.input: Doesn’t exist.
  • io.lines: Doesn't exist.
  • io.open: Modes “a+”, “r+”, and “w+” are not supported.
  • io.output: Doesn’t exist.
  • io.popen: Doesn’t exist.
  • io.read: Only allows format string “*l”.
  • io.tmpfile: Doesn’t exist.
  • file:read: Doesn’t support format string “*n” or a character count.
  • file:seek: Doesn’t exist.
  • file:setvbuf: Doesn’t exist.

All of the capabilities in this API are also available in the Fs API, along with some other functions not directly related to reading and writing individual files.