summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorJouke Witteveen <j.witteveen@gmail.com>2025-07-14 16:12:30 +0200
committerJussi Pakkanen <jussi.pakkanen@mailbox.org>2025-07-24 16:04:48 +0300
commit277d7268be5c730823ddac0cacd651c826043918 (patch)
tree94ad1c0f23acf7b72ee1bec63e1ed1c670044abb /docs
parent884fb4eefcfdb17a8434ac4a32600e120021641a (diff)
downloadmeson-277d7268be5c730823ddac0cacd651c826043918.tar.gz
Add suffix function to the fs module
Diffstat (limited to 'docs')
-rw-r--r--docs/markdown/Fs-module.md15
-rw-r--r--docs/markdown/snippets/fs_suffix.md4
2 files changed, 18 insertions, 1 deletions
diff --git a/docs/markdown/Fs-module.md b/docs/markdown/Fs-module.md
index 7ba4832a0..91c706eb9 100644
--- a/docs/markdown/Fs-module.md
+++ b/docs/markdown/Fs-module.md
@@ -206,13 +206,26 @@ fs.name('foo/bar/baz.dll.a') # baz.dll.a
*since 0.54.0*
Returns the last component of the path, dropping the last part of the
-suffix
+suffix.
```meson
fs.stem('foo/bar/baz.dll') # baz
fs.stem('foo/bar/baz.dll.a') # baz.dll
```
+### suffix
+
+*since 1.9.0*
+
+Returns the last dot-separated portion of the final component of the path
+including the dot, if any.
+
+```meson
+fs.suffix('foo/bar/baz.dll') # .dll
+fs.suffix('foo/bar/baz.dll.a') # .a
+fs.suffix('foo/bar') # (empty)
+```
+
### read
- `read(path, encoding: 'utf-8')` *(since 0.57.0)*:
return a [string](Syntax.md#strings) with the contents of the given `path`.
diff --git a/docs/markdown/snippets/fs_suffix.md b/docs/markdown/snippets/fs_suffix.md
new file mode 100644
index 000000000..7059008f8
--- /dev/null
+++ b/docs/markdown/snippets/fs_suffix.md
@@ -0,0 +1,4 @@
+## Added suffix function to the FS module
+
+The basename and stem were already available. For completeness, expose also the
+suffix.