diff options
Diffstat (limited to 'docs/markdown')
-rw-r--r-- | docs/markdown/Fs-module.md | 31 | ||||
-rw-r--r-- | docs/markdown/snippets/fsmodule.md | 10 |
2 files changed, 41 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.') +``` |