delete a file
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | file |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| character(len=100), | public | :: | cmd |
SUBROUTINE FileDelete & ! (file) IMPLICIT NONE !Arguments with intent(in): CHARACTER (LEN = *), INTENT(IN) :: file ! Local declarations: CHARACTER (LEN = 100) :: cmd !------------end of declaration------------------------------------------------ IF (GetOS () == WIN32) THEN !detected Windows OS cmd = 'del ' // file CALL System (cmd) ELSE !detected unix like OS, including linux cmd = 'rm ' // file CALL System (cmd) END IF END SUBROUTINE FileDelete