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

create folder with time and date

grpllrne
Beginner
1,316 Views

hello

im having problems to create a simple folder with time and date and then create a file with custom filename, could someone please help me?

"USE IFPORT
LOGICAL(4) result
character(len=10) :: time,date
call date_and_time(time=time)
call date_and_time(date=date)
result = MAKEDIRQQ(time,date)
OPEN(UNIT=404, ACCESS='SEQUENTIAL', FORM='BINARY', FILE='/time,date/filename', STATUS='REPLACE', convert='big_endian')
CLOSE(unit=404)"

thank you for your attention

0 Kudos
1 Reply
mecej4
Honored Contributor III
1,316 Views

There are numerous errors in your lines of code. You will need to sit down with a Fortran language manual and check that each line is syntactically correct and that it has the meaning that you wish it to have.

Here are some points.

  • The variable names that you declare in the third line conflict with module variables in IFPORT.
  • MAKEDIRQQ takes a single character argument, and that argument must have a value that is suitable for a directory name.
  • FILE='/time,date/filename' implies that you want the filename to be, literally, the string /time,date/filename . Probably not what you wanted.
0 Kudos
Reply