From 46788d1b5bb72f59cc931e54912c81666ce30f84 Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Tue, 5 Nov 2019 20:07:21 +0200 Subject: Created the filesystem module. --- docs/markdown/Fs-module.md | 31 +++++++++++++++++++++++++++++++ docs/markdown/snippets/fsmodule.md | 10 ++++++++++ 2 files changed, 41 insertions(+) create mode 100644 docs/markdown/Fs-module.md create mode 100644 docs/markdown/snippets/fsmodule.md (limited to 'docs/markdown') 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.') +``` -- cgit v1.1