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
Example
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.

EXAMPLE

Sample program:

   program demo_system_dir
   use M_system, only : system_dir, system_isdir
   implicit none
   character(len=:),allocatable :: dirname
      write(*, ’(a)’)system_dir(pattern=’*.f90’)
      dirname=’/tmp’
      if(system_isdir(dirname))then
         write(*, ’(a)’)system_dir(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) July 22, 2023
Generated by manServer 1.08 from 9cfa7d5c-8ff0-4668-81ba-2818170a08b0 using man macros.