You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,6 +21,8 @@ Keep the changelog pleasant to read in the text editor:
21
21
version 1.3.0
22
22
---------------------------
23
23
24
+
+ Added `list_directory`, `list_directory_recursive`, and `list_subdirectories` standard library functions for listing the contents of a `Directory` as `Array[File]` or `Array[Directory]`, enabling scatter-gather patterns over directory contents.
25
+
24
26
+ Clarified that relative paths in `File` and `Directory` declarations are resolved relative to the WDL document's parent directory outside the `output` section, and relative to the task's execution directory inside the `output` section. Also clarified that optional files evaluate to `None` in both contexts if the path does not exist.
Returns an array of all files in the top level of the given directory. If the optional glob pattern is provided, only files whose basenames match the pattern are included. Subdirectories are not included in the result; use [`list_subdirectories`](#list_subdirectories) to obtain those.
8771
+
8772
+
Results are sorted lexicographically by basename to ensure deterministic ordering across platforms and filesystems.
8773
+
8774
+
When a glob pattern is provided, it follows standard glob matching rules: patterns without a leading `.` do not match hidden files (dotfiles). When no pattern is provided, all files are returned including hidden files.
8775
+
8776
+
**Parameters**
8777
+
8778
+
1.`Directory`: The directory whose immediate file contents to list.
8779
+
2.`String`: (Optional) A glob pattern to filter results by basename (e.g., `"*.fastq.gz"`).
8780
+
8781
+
**Returns**: An `Array[File]` containing the files in the top level of the directory that match the pattern. Returns an empty array if the directory contains no matching files.
8782
+
8783
+
**Restrictions**: This function reads directory contents and may only be called in a context where the directory exists. If the directory is an input to a task or workflow, then it may be called anywhere in that task or workflow.
Returns an array of all files at any depth within the given directory (recursive walk). If the optional glob pattern is provided, only files whose basenames match the pattern are included. Subdirectories themselves are not included in the result.
8905
+
8906
+
Results are sorted lexicographically by their path relative to the input directory.
8907
+
8908
+
When a glob pattern is provided, it follows standard glob matching rules: patterns without a leading `.` do not match hidden files (dotfiles). When no pattern is provided, all files are returned including hidden files.
8909
+
8910
+
**Parameters**
8911
+
8912
+
1.`Directory`: The directory to recursively list.
8913
+
2.`String`: (Optional) A glob pattern to filter results by basename (e.g., `"*.bam"`).
8914
+
8915
+
**Returns**: An `Array[File]` containing all files found recursively within the directory that match the pattern. Returns an empty array if no matching files are found.
8916
+
8917
+
**Restrictions**: This function reads directory contents and may only be called in a context where the directory exists. If the directory is an input to a task or workflow, then it may be called anywhere in that task or workflow.
Returns an array of immediate child directories within the given directory. Only direct children are returned; this function is not recursive.
8977
+
8978
+
Results are sorted lexicographically by basename to ensure deterministic ordering across platforms and filesystems.
8979
+
8980
+
**Parameters**
8981
+
8982
+
1.`Directory`: The parent directory whose immediate subdirectories to list.
8983
+
8984
+
**Returns**: An `Array[Directory]` containing the immediate subdirectories. Returns an empty array if the directory contains no subdirectories.
8985
+
8986
+
**Restrictions**: This function reads directory contents and may only be called in a context where the directory exists. If the directory is an input to a task or workflow, then it may be called anywhere in that task or workflow.
8987
+
8988
+
<details>
8989
+
<summary>
8990
+
Example: process_samples_workflow.wdl
8991
+
8992
+
```wdl
8993
+
version 1.4
8994
+
8995
+
workflow process_samples {
8996
+
input {
8997
+
Directory data_root # contains one subdirectory per sample
0 commit comments