From 7d60dc2644c658e7ae5c9d609fa65c622fe2d230 Mon Sep 17 00:00:00 2001 From: "debing.sun" Date: Wed, 21 Feb 2024 11:09:11 +0800 Subject: [PATCH 1/4] Add Lua os library section --- docs/interact/programmability/lua-api.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/interact/programmability/lua-api.md b/docs/interact/programmability/lua-api.md index f5d6e3e505..b544c44358 100644 --- a/docs/interact/programmability/lua-api.md +++ b/docs/interact/programmability/lua-api.md @@ -670,6 +670,9 @@ The following [standard Lua libraries](https://www.lua.org/manual/5.1/manual.htm * The [_String Manipulation (string)_ library](https://www.lua.org/manual/5.1/manual.html#5.4) * The [_Table Manipulation (table)_ library](https://www.lua.org/manual/5.1/manual.html#5.5) * The [_Mathematical Functions (math)_ library](https://www.lua.org/manual/5.1/manual.html#5.6) +* The [_Operating System Facilities (os)_ library](https://www.lua.org/manual/5.1/manual.html#5.8) + Note that for sandbox security, currently only the following os API is exposed: + * `os.clock()` In addition, the following external libraries are loaded and accessible to scripts: From 869dcce224b288b37b7bb1e77d9a5861af4a0138 Mon Sep 17 00:00:00 2001 From: "debing.sun" Date: Wed, 21 Feb 2024 12:12:47 +0800 Subject: [PATCH 2/4] Improve --- docs/interact/programmability/lua-api.md | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/docs/interact/programmability/lua-api.md b/docs/interact/programmability/lua-api.md index b544c44358..26b30882d5 100644 --- a/docs/interact/programmability/lua-api.md +++ b/docs/interact/programmability/lua-api.md @@ -670,9 +670,7 @@ The following [standard Lua libraries](https://www.lua.org/manual/5.1/manual.htm * The [_String Manipulation (string)_ library](https://www.lua.org/manual/5.1/manual.html#5.4) * The [_Table Manipulation (table)_ library](https://www.lua.org/manual/5.1/manual.html#5.5) * The [_Mathematical Functions (math)_ library](https://www.lua.org/manual/5.1/manual.html#5.6) -* The [_Operating System Facilities (os)_ library](https://www.lua.org/manual/5.1/manual.html#5.8) - Note that for sandbox security, currently only the following os API is exposed: - * `os.clock()` +* The [_Operating System Facilities (os)_ library](#os-library) In addition, the following external libraries are loaded and accessible to scripts: @@ -681,6 +679,18 @@ In addition, the following external libraries are loaded and accessible to scrip * The [_cmsgpack_ library](#cmsgpack-library) * The [_bitop_ library](#bitop-library) +### _os_ library + +* Since version: 8.0.0 +* Available in scripts: yes +* Available in functions: yes + +_os_ provides a set of functions for dealing with date, time, and system commands. +More details can be found in the [Operating System Facilities](https://www.lua.org/manual/5.1/manual.html#5.8). +Note that for sandbox security, currently only the following os functions is exposed: + +* [`struct.clock()`](#os.clock) + ### _struct_ library * Since version: 2.6.0 @@ -688,7 +698,6 @@ In addition, the following external libraries are loaded and accessible to scrip * Available in functions: yes _struct_ is a library for packing and unpacking C-like structures in Lua. -It provides the following functions: * [`struct.pack()`](#struct.pack) * [`struct.unpack()`](#struct.unpack) From f847aeb573759c2d2358ad13745951dd6aee067f Mon Sep 17 00:00:00 2001 From: "debing.sun" Date: Wed, 21 Feb 2024 12:16:08 +0800 Subject: [PATCH 3/4] Improve --- docs/interact/programmability/lua-api.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/interact/programmability/lua-api.md b/docs/interact/programmability/lua-api.md index 26b30882d5..c048ad0979 100644 --- a/docs/interact/programmability/lua-api.md +++ b/docs/interact/programmability/lua-api.md @@ -689,7 +689,7 @@ _os_ provides a set of functions for dealing with date, time, and system command More details can be found in the [Operating System Facilities](https://www.lua.org/manual/5.1/manual.html#5.8). Note that for sandbox security, currently only the following os functions is exposed: -* [`struct.clock()`](#os.clock) +* `os.clock()` ### _struct_ library From be65125be346f764415542abfe5401a6869b1b8e Mon Sep 17 00:00:00 2001 From: "debing.sun" Date: Wed, 21 Feb 2024 14:57:12 +0800 Subject: [PATCH 4/4] Revert mistake deletion --- docs/interact/programmability/lua-api.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/interact/programmability/lua-api.md b/docs/interact/programmability/lua-api.md index c048ad0979..3fa62f10c9 100644 --- a/docs/interact/programmability/lua-api.md +++ b/docs/interact/programmability/lua-api.md @@ -698,6 +698,7 @@ Note that for sandbox security, currently only the following os functions is exp * Available in functions: yes _struct_ is a library for packing and unpacking C-like structures in Lua. +It provides the following functions: * [`struct.pack()`](#struct.pack) * [`struct.unpack()`](#struct.unpack)