From ed19eb24434a25babae90909b38eedd6315246f4 Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Tue, 8 Jun 2021 16:07:42 -0400 Subject: [PATCH] document the enhancement to the Fs module permitting File arguments Add a release notes snippet too! --- docs/markdown/Fs-module.md | 11 ++++++++--- docs/markdown/snippets/fs-module-accepts-files.md | 6 ++++++ 2 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 docs/markdown/snippets/fs-module-accepts-files.md diff --git a/docs/markdown/Fs-module.md b/docs/markdown/Fs-module.md index df9f305b4..663aba41b 100644 --- a/docs/markdown/Fs-module.md +++ b/docs/markdown/Fs-module.md @@ -3,6 +3,10 @@ This module provides functions to inspect the file system. It is available starting with version 0.53.0. +Since 0.59.0, all functions accept `files()` objects if they can do something +useful with them (this excludes `exists`, `is_dir`, `is_file`, `is_absolute` +since a `files()` object is always the absolute path to an existing file). + ## File lookup rules Non-absolute paths are looked up relative to the directory where the @@ -35,8 +39,8 @@ name exists on the file system. ### is_symlink -Takes a single string argument and returns true if the path pointed to -by the string is a symbolic link. +Takes a single string or (since 0.59.0) `files()` argument and returns true if +the path pointed to by the string is a symbolic link. ## File Parameters @@ -44,7 +48,8 @@ by the string is a symbolic link. *since 0.54.0* -Return a boolean indicating if the path string specified is absolute, WITHOUT expanding `~`. +Return a boolean indicating if the path string or (since 0.59.0) `files()` +specified is absolute, WITHOUT expanding `~`. Examples: diff --git a/docs/markdown/snippets/fs-module-accepts-files.md b/docs/markdown/snippets/fs-module-accepts-files.md new file mode 100644 index 000000000..8c602fd44 --- /dev/null +++ b/docs/markdown/snippets/fs-module-accepts-files.md @@ -0,0 +1,6 @@ +## Fs Module now accepts files objects + +It is now possible to define a `files()` object and run most Fs module +functions on the file, rather than passing a string and hoping it is in the +same directory. +