From 01493f51a235d0f2f14b5f3c88b220ba4eeed46f Mon Sep 17 00:00:00 2001 From: Alexander Turenko Date: Sat, 9 Jul 2022 01:11:26 +0300 Subject: [PATCH] fio: clarify fio.basename() with slash at end Fixes #2124 --- doc/reference/reference_lua/fio.rst | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/doc/reference/reference_lua/fio.rst b/doc/reference/reference_lua/fio.rst index 0d503d3305..25f6b8bd9b 100644 --- a/doc/reference/reference_lua/fio.rst +++ b/doc/reference/reference_lua/fio.rst @@ -197,6 +197,10 @@ Below is a list of all ``fio`` functions and members. Given a full path name, remove all but the final part (the file name). Also remove the suffix, if it is passed. + Note that the basename of a path with a trailing slash is an empty string. + It is different from how the Unix ``basename`` program interprets such a + path. + :param string path-name: path name :param string suffix: suffix @@ -212,6 +216,15 @@ Below is a list of all ``fio`` functions and members. - my ... + **Example with a trailing slash:** + + .. code-block:: tarantoolsession + + tarantool> fio.basename('/path/to/') + --- + - + ... + .. _fio-dirname: .. function:: dirname(path-name)