Skip to content

fio: clarify fio.basename() with slash at end #3013

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 15, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions doc/reference/reference_lua/fio.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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)
Expand Down