summaryrefslogtreecommitdiffstats
path: root/DOCS/man
diff options
context:
space:
mode:
authorAvi Halachmi (:avih) <avihpit@yahoo.com>2021-06-10 12:32:28 +0300
committeravih <avih@users.noreply.github.com>2021-06-13 22:53:37 +0300
commitbc9d556f3a890cf5f99e9dced0117e2d8a91ff09 (patch)
tree65b149b8d068e17c9b777a689e116430dbe791b0 /DOCS/man
parent03b9f8e32362b4ca8fcf4b14e0008ca3b13e06ce (diff)
downloadmpv-bc9d556f3a890cf5f99e9dced0117e2d8a91ff09.tar.bz2
mpv-bc9d556f3a890cf5f99e9dced0117e2d8a91ff09.tar.xz
js: add mp.utils.append_file
Also, for consistency with other APIs, mp.utils.{write,append}_file now return true on success (and still throw on any error).
Diffstat (limited to 'DOCS/man')
-rw-r--r--DOCS/man/javascript.rst10
1 files changed, 8 insertions, 2 deletions
diff --git a/DOCS/man/javascript.rst b/DOCS/man/javascript.rst
index 1e5ce99cdc..0cd4fb806e 100644
--- a/DOCS/man/javascript.rst
+++ b/DOCS/man/javascript.rst
@@ -221,7 +221,8 @@ Additional utilities
``mp.utils.get_user_path(path)``
Expands (mpv) meta paths like ``~/x``, ``~~/y``, ``~~desktop/z`` etc.
- ``read_file``, ``write_file`` and ``require`` already use this internaly.
+ ``read_file``, ``write_file``, ``append_file`` and ``require`` already use
+ this internaly.
``mp.utils.read_file(fname [,max])``
Returns the content of file ``fname`` as string. If ``max`` is provided and
@@ -232,7 +233,12 @@ Additional utilities
prefixed with ``file://`` as simple protection against accidental arguments
switch, e.g. ``mp.utils.write_file("file://~/abc.txt", "hello world")``.
-Note: ``read_file`` and ``write_file`` throw on errors, allow text content only.
+``mp.utils.append_file(fname, str)``
+ Same as ``mp.utils.write_file`` if the file ``fname`` does not exist. If it
+ does exist then append instead of overwrite.
+
+Note: ``read_file``, ``write_file`` and ``append_file`` throw on errors, allow
+text content only.
``mp.get_time_ms()``
Same as ``mp.get_time()`` but in ms instead of seconds.