os_delete_dir Subroutine

public subroutine os_delete_dir(is_unix, dir, echo)

Delete directory using system OS remove directory commands

Arguments

Type IntentOptional Attributes Name
logical, intent(in) :: is_unix
character(len=*), intent(in) :: dir
logical, intent(in), optional :: echo

Source Code

subroutine os_delete_dir(is_unix, dir, echo)
    logical, intent(in) :: is_unix
    character(len=*), intent(in) :: dir
    logical, intent(in), optional :: echo

    if (is_unix) then
        call run('rm -rf ' // dir, echo=echo,verbose=.false.)
    else
        call run('rmdir /s/q ' // dir, echo=echo,verbose=.false.)
    end if

end subroutine os_delete_dir