[vlc-commits] lua: Add doc

Hugo Beauzée-Luyssen git at videolan.org
Thu Apr 12 17:30:26 CEST 2018


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

lua: Add doc

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=02d8a9cc3a531a0b0c52595ac97eed623bf4b6a3
---

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

diff --git a/share/lua/README.txt b/share/lua/README.txt
index 0945de67a8..43e0926f83 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
 ---------
@@ -131,6 +139,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