diff options
author | TSaaristo <tero.saaristo@gmail.com> | 2017-12-11 23:04:51 +0200 |
---|---|---|
committer | Jan Ekström <jeebjp@gmail.com> | 2017-12-13 21:55:28 +0200 |
commit | 522bfe5be1212f356acbbd7d566092f8bd8d0748 (patch) | |
tree | 4e0992a9f092e9794c00290bd85f0aa8af30e8c0 /DOCS/man/javascript.rst | |
parent | 47131365a323914d667ba23d50474717f88cd81c (diff) | |
download | mpv-522bfe5be1212f356acbbd7d566092f8bd8d0748.tar.bz2 mpv-522bfe5be1212f356acbbd7d566092f8bd8d0748.tar.xz |
lua+js: implement utils.file_info()
This commit introduces mp.utils.file_info() for querying information
on file paths, implemented for both Lua and Javascript.
The function takes a file path as an argument and returns a Lua table /
JS object upon success. The table/object will contain the values:
mode, size, atime, mtime, ctime and the convenience booleans is_file, is_dir.
On error, the Lua side will return `nil, error` and the Javascript side
will return `undefined` (and mark the last error).
This feature utilizes the already existing cross-platform `mp_stat()`
function.
Diffstat (limited to 'DOCS/man/javascript.rst')
-rw-r--r-- | DOCS/man/javascript.rst | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/DOCS/man/javascript.rst b/DOCS/man/javascript.rst index 995899d07b..419f473e2c 100644 --- a/DOCS/man/javascript.rst +++ b/DOCS/man/javascript.rst @@ -168,6 +168,8 @@ Otherwise, where the Lua APIs return ``nil`` on error, JS returns ``undefined``. ``mp.utils.readdir(path [, filter])`` (LE) +``mp.utils.file_info(path)`` (LE) + ``mp.utils.split_path(path)`` ``mp.utils.join_path(p1, p2)`` |