xref: /phasta/phSolver/common/test/chdir_mod.f (revision 1e99f302ca5103688ae35115c2fefb7cfa6714f1)
1      module chdir_mod
2        implicit none
3        interface
4          integer function c_chdir(path) bind(C, name="chdir")
5            use iso_c_binding
6            character(c_char) :: path(*)
7          end function
8        end interface
9        contains
10        subroutine chdir(path, err)
11          use iso_c_binding
12          character(len=*) :: path
13          integer, optional, intent(out) :: err
14          integer :: loc_err
15          loc_err = c_chdir(path//c_null_char)
16          if( present(err) ) err = loc_err
17        end subroutine
18      end module chdir_mod
19