system_dir(3f) - [M_io] return filenames in a directory matching specified wildcard string (LICENSE:PD)
Synopsis
Description
Options
Returns
Example
Author
License
function system_dir(directory,pattern)
character(len=*),intent(in),optional :: directory character(len=*),intent(in),optional :: pattern character(len=:),allocatable :: system_dir(:)
returns an array of filenames in the specified directory matching the wildcard string (which defaults to "*").
DIRECTORY name of directory to match filenames in. Defaults to ".". PATTERN wildcard string matching the rules of the matchw(3f) function. Basically
o "*" matches anything o "?" matches any single character
system_dir An array right-padded to the length of the longest filename. Note that this means filenames actually containing trailing spaces in their names may be incorrect.
Sample program:
program demo_system_dir use M_system, only : system_dir implicit none write(*, (a))system_dir(pattern=*.f90) end program demo_system_dir
John S. Urban
Public Domain
system_dir (3) | March 11, 2021 |