| 如题。想在某个目录下创建名称叫“0.05”的文件夹,并在此文件夹下再创建5个文件夹,在这5个文件夹中分别写入5个叫data的文件。代码如下: [Fortran] syntaxhighlighter_viewsource syntaxhighlighter_copycode     program example
    use ifport
    implicit none
    integer i
    character(len=56) temp,name
    integer istatus1,istatus2,istatus3,istatus4,istatus5
    name='0.05'
    istatus1=system("Md "//trim(name)) !建立文件夹
    
    do i=1,5
        write(temp,*) i
        istatus2=CHDIR(trim(name)) !定位到上述建立的文件夹的路径
        istatus3=system("Md "//trim(temp)) !在此路径上再建一层文件夹
        istatus4=CHDIR(trim(temp)) !定位到新一层的文件夹
        open(11,file='data')
        write(11,*) i
        
        istatus5=CHDIR("..")
        close(11)
    end do
    read(*,*)
    end program example
然而运行后,却变成了图1所示的问题,即名称叫“0.05”的文件夹下的5个文件夹建成了,但是data文件没有分别放在这5个文件夹中。请教各位,该如何修改?谢谢大家。
 
 
 |