summaryrefslogtreecommitdiff
path: root/docs/markdown/Fs-module.md
diff options
context:
space:
mode:
authorTristan Partin <tristan@partin.io>2023-08-07 12:30:15 -0500
committerXavier Claessens <xclaesse@gmail.com>2023-08-17 17:05:49 -0400
commitf52bcaa27fc125ab9ae583af466ba99c164169f3 (patch)
tree34ecddd4e69581075035f405ff1fddcada6f252f /docs/markdown/Fs-module.md
parentcbf8e67f19e384e5f8eb7f65d3020551769de545 (diff)
downloadmeson-f52bcaa27fc125ab9ae583af466ba99c164169f3.tar.gz
Add fs.relative_to()
Returns a relative path from arg 2 to arg 1 similar to os.path.relpath().
Diffstat (limited to 'docs/markdown/Fs-module.md')
-rw-r--r--docs/markdown/Fs-module.md14
1 files changed, 14 insertions, 0 deletions
diff --git a/docs/markdown/Fs-module.md b/docs/markdown/Fs-module.md
index cc67355b5..bf9ddba9d 100644
--- a/docs/markdown/Fs-module.md
+++ b/docs/markdown/Fs-module.md
@@ -224,6 +224,20 @@ fs.stem('foo/bar/baz.dll.a') # baz.dll
project. If the file specified by `path` is a `files()` object it
cannot refer to a built file.
+### relative_to
+
+*Since 1.3.0*
+
+Return a relative filepath. In event a relative path could not be found, the
+absolute path of `to` is returned. Relative path arguments will be assumed to be
+relative to `meson.current_source_dir()`.
+
+Has the following positional arguments:
+ - to `str | file | custom_tgt | custom_idx | tgt`: end path
+ - from `str | file | custom_tgt | custom_idx | tgt`: start path
+
+returns:
+ - a string
### copyfile