From 66ea129b7ab98fb880e083c4886ddd0d7e96a349 Mon Sep 17 00:00:00 2001 From: XeonSquared Date: Fri, 20 Mar 2020 13:01:50 +1100 Subject: [PATCH] commented some io library functions --- module/io.lua | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/module/io.lua b/module/io.lua index b3401f0..79b69ed 100644 --- a/module/io.lua +++ b/module/io.lua @@ -1,12 +1,12 @@ io = {} -function io.open(path,mode) +function io.open(path,mode) -- Open file *path* in *mode*. Returns a buffer object. local f,e = fs.open(path, mode) if not f then return false, e end return buffer.new(mode,f) end -function io.input(fd) +function io.input(fd) -- Sets the default input stream to *fd* if provided, either as a buffer as a path. Returns the default input stream. if type(fd) == "string" then fd=io.open(fd,"rb") end @@ -15,7 +15,7 @@ function io.input(fd) end return os.getenv("STDIN") end -function io.output(fd) +function io.output(fd) -- Sets the default output stream to *fd* if provided, either as a buffer as a path. Returns the default output stream. if type(fd) == "string" then fd=io.open(fd,"wb") end @@ -25,14 +25,14 @@ function io.output(fd) return os.getenv("STDOUT") end -function io.read(...) - return io.input():read() +function io.read(...) -- Reads from the default input stream. + return io.input():read(...) end -function io.write(...) +function io.write(...) -- Writes its arguments to the default output stream. io.output():write(...) end -function print(...) +function print(...) -- Writes each argument to the default output stream, separated by newlines. for k,v in ipairs({...}) do io.write(tostring(v).."\n") end