Class iso_c_functions
In: PosixModule/iso_c_functions.F90
iso_c_binding iso_c_functions dot/f_38.png

Methods

f_mkdir  

Included Modules

iso_c_binding

Public Instance methods

Subroutine :
path :character(len=*), intent(in)
ierr :integer, intent(inout)

[Source]

subroutine f_mkdir(path,ierr)
  implicit none
  character(len=*), intent(in)    :: path
  integer,          intent(inout) :: ierr
  character(kind=C_CHAR,len=1), allocatable :: c_path(:)
  integer :: length,i

  !---------------------------------------------
  ! To convert C string,
  ! add a null terminator to the fortran string
  !---------------------------------------------
  length = LEN(TRIM(ADJUSTL(path)))+1
  allocate(c_path(length))
  do i=1,length-1
    c_path(i) = path(i:i)
  enddo
  c_path(length) = C_NULL_CHAR  

  call pf_mkdir(c_path,ierr)
  deallocate(c_path)
  return
end subroutine