aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/markdown/Fs-module.md31
-rw-r--r--docs/markdown/snippets/fsmodule.md10
-rw-r--r--docs/sitemap.txt1
3 files changed, 42 insertions, 0 deletions
diff --git a/docs/markdown/Fs-module.md b/docs/markdown/Fs-module.md
new file mode 100644
index 0000000..e68bf68
--- /dev/null
+++ b/docs/markdown/Fs-module.md
@@ -0,0 +1,31 @@
+# FS (filesystem) module
+
+This module provides functions to inspect the file system. It is
+available starting with version 0.53.0.
+
+## File lookup rules
+
+Non-absolute paths are looked up relative to the directory where the
+current `meson.build` file is.
+
+### exists
+
+Takes a single string argument and returns true if an entity with that
+name exists on the file system. This can be a file, directory or a
+special entry such as a device node.
+
+### is_dir
+
+Takes a single string argument and returns true if a directory with
+that name exists on the file system. This method follows symbolic
+links.
+
+### is_file
+
+Takes a single string argument and returns true if an file with that
+name exists on the file system. This method follows symbolic links.
+
+### is_symlink
+
+Takes a single string argument and returns true if the path pointed to
+by the string is a symbolic link.
diff --git a/docs/markdown/snippets/fsmodule.md b/docs/markdown/snippets/fsmodule.md
new file mode 100644
index 0000000..d668b18
--- /dev/null
+++ b/docs/markdown/snippets/fsmodule.md
@@ -0,0 +1,10 @@
+## A new module for filesystem operations
+
+The new `fs` module can be used to examine the contents of the current
+file system.
+
+```meson
+fs = import('fs')
+assert(fs.exists('important_file'),
+ 'The important file is missing.')
+```
diff --git a/docs/sitemap.txt b/docs/sitemap.txt
index c2bc610..5c78694 100644
--- a/docs/sitemap.txt
+++ b/docs/sitemap.txt
@@ -32,6 +32,7 @@ index.md
Modules.md
CMake-module.md
Dlang-module.md
+ Fs-module.md
Gnome-module.md
Hotdoc-module.md
i18n-module.md