subroutineremove_file
subroutine remove_file(path)
Delete file path, if it can be. This can be called from parallel code.
Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
| path | character(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