[vlc-commits] lua: Add doc

Hugo Beauzée-Luyssen git at videolan.org
Tue Apr 17 14:02:12 CEST 2018


vlc/vlc-3.0 | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Thu Apr 12 17:30:03 2018 +0200| [69569cf56bf2788722dcfbd7d267771ba9923178] | committer: Hugo Beauzée-Luyssen

lua: Add doc

(cherry picked from commit 02d8a9cc3a531a0b0c52595ac97eed623bf4b6a3)
Signed-off-by: Hugo Beauzée-Luyssen <hugo at beauzee.fr>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=69569cf56bf2788722dcfbd7d267771ba9923178
---

 share/lua/README.txt | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/share/lua/README.txt b/share/lua/README.txt
index eb782ee030..1c7bf5dd63 100644
--- a/share/lua/README.txt
+++ b/share/lua/README.txt
@@ -86,6 +86,14 @@ w:get_value(): Return identifier of the selected item. Corresponds to the text v
 w:clear(): Clear a list or drop_down widget. After that, all values previously added are lost.
 w:get_selection(): Retrieve a table representing the current selection. Keys are the ids, values are the texts associated. Applies to: list.
 
+errno
+-----
+List of potential errors. It contains the following values:
+  .ENOENT: No such file or directory
+  .EEXIST: File exists
+  .EACCESS: Permission denied
+  .EINVAL: Invalid argument
+
 
 Extension
 ---------
@@ -133,6 +141,24 @@ input.item(): Get the current input item. Input item methods are:
     .played_abuffers
     .lost_abuffers
 
+Input/Output
+------------
+All path for this namespace are expected to be passed as UTF8 strings.
+
+io.mkdir("path", "mode"): Similar to mkdir(2). The mode is passed as a string
+  to allow for octal representations. This returns a success code (non 0 in
+  case of failure), and a more specific error code as its 2nd returned value
+  in case of failure. The error code is to be used with vlc.errno
+io.readdir("path"): Lists all files & directories in the provided folder.
+io.open("path"[, "mode"]): Similar to lua's io.open. Mode is optional and 
+  defaults to "r". It returns a file object with the following member functions:
+    .read
+    .write
+    .seek
+    .flush
+    .close
+  all of which are used exactly like the lua object returned by io.open
+
 Messages
 --------
 msg.dbg( [str1, [str2, [...]]] ): Output debug messages (-vv).



More information about the vlc-commits mailing list