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