C Library Functions - system_dir (3)
NAME
system_dir(3f) - [M_system] return filenames in a directory matching
specified wildcard string
(LICENSE:PD)
CONTENTS
Synopsis
Description
Options
Returns
Examples
Author
License
SYNOPSIS
function system_dir(directory,pattern,ignorecase)
character(len=*),intent(in),optional :: directory
character(len=*),intent(in),optional :: pattern
logical,intent(in),optional :: ignorecase
character(len=:),allocatable :: system_dir(:)
DESCRIPTION
returns an array of filenames in the specified directory matching
the wildcard string (which defaults to "*").
OPTIONS
|
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
|
|
|
|
IGNORECASE |
| |
Boolean value indicating whether to ignore case or not
when performing matching
|
|
RETURNS
|
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.
|
|
EXAMPLES
Sample program:
program demo_system_dir
use M_system, only : system_dir, system_isdir
implicit none
character(len=:),allocatable :: dirname
write(*, ("*.f90: ",a))system_dir(pattern=*.f90)
write(*, ("*.F90: ",a))system_dir(pattern=*.F90)
write(*, ("ignorecase:*.F90: ",a))system_dir(pattern=*.F90,ignorecase=.true.)
write(*, ("ignorecase:*.f90: ",a))system_dir(pattern=*.F90,ignorecase=.true.)
dirname=/tmp
if(system_isdir(dirname))then
write(*, ("/tmp/*.f90: ",a))system_dir(directory=/tmp,pattern=*.f90)
else
write(*, (a))<WARNING:>//dirname// does not exist
endif
end program demo_system_dir
AUTHOR
John S. Urban
LICENSE
Public Domain
| Nemo Release 3.1 | system_dir (3) | June 29, 2025 |
Generated by manServer 1.08 from 21bd1987-dbf6-48fa-be11-ddda3400033c using man macros.