From 84ec5d2aee43794386b1e7505b76a4f2800c1a33 Mon Sep 17 00:00:00 2001 From: Inversion Date: Sat, 27 Mar 2021 23:11:47 -0700 Subject: [PATCH] Add documentation for the OS library --- docs/stdlib.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/stdlib.md b/docs/stdlib.md index 38624ee..e349b35 100644 --- a/docs/stdlib.md +++ b/docs/stdlib.md @@ -52,3 +52,14 @@ Includes functions to do some common algebraic operations. | math.acos | `(cos)` -> `` | Returns the arc cosine of radian `Rad` | `math.deg(math.acos(-1))` -> `180` | | math.atan | `(tan)` -> `` | Returns the arc tangent of radian `Rad` | `math.deg(math.atan(1))` -> `45` | > -> means 'returns' + +## OS Library + +Includes functions that interact with the operating system. + +| Name | Type | Behavior | Example | +| ------------ | ------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------ | +| os.read | `(path)` -> `` or `` | Returns a file's contents or nil if it doesn't exist/an error occurred | `os.read("path")` -> `Hello, World!`| +| os.time | `()` -> `` | Returns the system time in Epoch format | `os.time()` -> `1.61691e+09` | +| os.system | `(cmd)` -> `` | Runs a system command as if it were a terminal and returns the exit code | `os.system("mkdir test")` -> `0` | +> -> means 'returns' \ No newline at end of file