Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Creating a folder

denara
Beginner
412 Views
Hi.
Is there a way so that VF can create a folder? My program needs to write some output results, and I would like them to be written in different folders, created automatically by the program.
Thanks.
Andrea
0 Kudos
1 Reply
Les_Neilson
Valued Contributor II
412 Views

Andrea try this

 subroutine mkdir(name,ier)
use ifport
implicit none
! creates a directory
! Arguments
 integer, intent(out) :: IER
character(*), intent(in) :: NAME
! Local variables
 logical :: there
 ier = 1
! check and see if directory exists first
 inquire (directory=name,exist=there,err=100)
 if (there) then
ier = 0
else if (makedirqq(name)) then
ier = 0
else
ier = 1
end if
! return
100 return
 end subroutine MKDIR

0 Kudos
Reply