system関数(システムコマンドの実行)

実は、FortranでもPerlと同じようにシステム関数を使うことができる。

プログラム例

PROGRAM system_function
IMPLICIT NONE
INTEGER*4 :: results, system
CHARACTER*10 :: string
results=system('ls')        #lsコマンド
string= 'ls -l'
results=system(string)      #ls -l system関数に文字変数を代入できる
END PROGRAM system_function
最終更新:2011年04月14日 10:41