Finding the Fortran files under a directory.
Files are selected by extension. Entries are excluded by glob patterns: * and ? match within
a path component, ** across components, and [abc] / [!abc] match one character. A pattern
without a / is matched against an entry's name, one with a / against its path relative to
the directory being searched. Links to directories are not followed.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | private, | parameter | :: | MAX_DEPTH | = | 100 |
dir/name, or just name in the current directory.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | dir |
the directory, and the name of an entry in it |
||
| character(len=*), | intent(in) | :: | name |
the directory, and the name of an entry in it |
Hidden files and directories, and fpm's build directory.
A regular expression (for a full match) equivalent to the glob pattern glob.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | glob |
the glob pattern |
The files under directory root with one of the extensions (without the dot) that are not
excluded, sorted by path within each directory.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | root |
the directory to search |
||
| type(string_t), | intent(in) | :: | extensions(:) |
extensions of the files to collect, without the dot |
||
| type(string_t), | intent(in) | :: | exclude(:) |
glob patterns of the files and directories to skip |
||
| type(string_t), | intent(out), | allocatable | :: | files(:) |
paths of the files, |
Sort by name (insertion sort: directories are small).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(dir_entry_t), | intent(inout) | :: | entries(:) |
a directory listing |