Skip to content

Commit c85c94e

Browse files
authored
fio: clarify fio.basename() with slash at end (#3013)
Fixes #2124
1 parent 83ba625 commit c85c94e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

doc/reference/reference_lua/fio.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,10 @@ Below is a list of all ``fio`` functions and members.
197197
Given a full path name, remove all but the final part (the file name).
198198
Also remove the suffix, if it is passed.
199199

200+
Note that the basename of a path with a trailing slash is an empty string.
201+
It is different from how the Unix ``basename`` program interprets such a
202+
path.
203+
200204
:param string path-name: path name
201205
:param string suffix: suffix
202206

@@ -212,6 +216,15 @@ Below is a list of all ``fio`` functions and members.
212216
- my
213217
...
214218
219+
**Example with a trailing slash:**
220+
221+
.. code-block:: tarantoolsession
222+
223+
tarantool> fio.basename('/path/to/')
224+
---
225+
-
226+
...
227+
215228
.. _fio-dirname:
216229

217230
.. function:: dirname(path-name)

0 commit comments

Comments
 (0)