fdoc

subroutineremove_file

subroutine remove_file(path)

Delete file path, if it can be. This can be called from parallel code.

Arguments

NameTypeIntentAttributesDescription
pathcharacter(len=*)in

the file

Source

Show the code
subroutine remove_file(path)
    character(len=*), intent(in) :: path    !! the file
    integer :: unit, status

    !$omp critical (file_io)
    open (newunit=unit, file=path, status='old', iostat=status)
    if (status == 0) close (unit, status='delete', iostat=status)
    !$omp end critical (file_io)
end subroutine remove_file

Graphs

Called by