[UP]


Manual Reference Pages  - fileglob (3)

NAME

fileglob(3f) - [M_system] Read output of an ls(1) command from Fortran (LICENSE:PD)

CONTENTS

Synopsis
Description
Options
Example
Author
License

SYNOPSIS

subroutine fileglob(glob,list)

character(len=*),intent(in) :: glob character(len=*),pointer :: list(:)

DESCRIPTION

Non-portable procedure uses the shell and the ls(1) command to expand a filename and returns a pointer to a list of expanded filenames.

OPTIONS

glob Pattern for the filenames (like: *.txt)
list Allocated list of filenames (returned), the caller must deallocate it.

EXAMPLE

Read output of an ls(1) command from Fortran

   program demo_fileglob  ! simple unit test
      call tryit(’*.*’)
      call tryit(’/tmp/__notthere.txt’)
   contains

subroutine tryit(string) use M_system, only : fileglob character(len=255),pointer :: list(:) character(len=*) :: string call fileglob(string, list) write(*,*)’Files:’,size(list) write(*,’(a)’)(trim(list(i)),i=1,size(list)) deallocate(list) end subroutine tryit

end program demo_fileglob ! simple unit test

AUTHOR

John S. Urban

LICENSE

Public Domain


fileglob (3) July 05, 2020
Generated by manServer 1.08 from 89eb3cb1-d9a8-4e65-86e6-b16ccc3b207b using man macros.