diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2019-11-05 20:07:21 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2019-11-08 00:44:45 +0200 |
commit | 46788d1b5bb72f59cc931e54912c81666ce30f84 (patch) | |
tree | e3438d1a7f68a9a1518f672a167f57b514cd5679 /docs/markdown | |
parent | 48a719033ee6f1626a8878f66a43ee939dad4c62 (diff) | |
download | meson-46788d1b5bb72f59cc931e54912c81666ce30f84.zip meson-46788d1b5bb72f59cc931e54912c81666ce30f84.tar.gz meson-46788d1b5bb72f59cc931e54912c81666ce30f84.tar.bz2 |
Created the filesystem module.
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.') +``` |