79544290

Date: 2025-03-30 07:38:37
Score: 1
Natty:
Report link

There is [a subroutine called 'list_files' in fpm package](https://fortran-lang.github.io/fpm/proc/list_files.html).

program main
  use fpm_strings, only: string_t, str_ends_with
  use fpm_filesystem, only: list_files
  implicit none
  type(string_t), allocatable :: files(:)
  integer :: i
  call list_files("my_dir", files, .false.)
  do i=1, size(files)
    if (str_ends_with(files(i)%s, "txt")) then
      print *, files(i)%s
    endif
  enddo
end program main
Reasons:
  • Probably link only (1):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Matej