From 277d7268be5c730823ddac0cacd651c826043918 Mon Sep 17 00:00:00 2001 From: Jouke Witteveen Date: Mon, 14 Jul 2025 16:12:30 +0200 Subject: Add suffix function to the fs module --- docs/markdown/Fs-module.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'docs/markdown/Fs-module.md') 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`. -- cgit v1.2.3