I thought I found out how to create directories in this post
Creating directory with name containing real number in FORTRAN
But when I tried to create a directory in my Fortran 90 program
call system('mkdir -p out/test')
or
call system('mkdir out/test')
I don't get any compilation errors or warnings, but I get the following runtime error:
The syntax of the command is incorrect.
Any idea what is wrong? Any help is greatly appreciated!
From the error message I assume you are using Windows. Then, you have to use \
as a folder separator:
call system('mkdir out\test')
Also, -p
(the Unix option to create parent folders) is invalid for Windows (and also not required).
来源:https://stackoverflow.com/questions/24617016/fortran-90-create-directory-syntax-error