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

execute without waiting for finish

dajum
Novice
359 Views

I'm trying to figure out the best way to delete a directory without waiting for it to complete.  I have code that does this, but when there are lots of subdirectories and files it takes a long time to complete.  Once I've started the delete I'd like the rest of the program to continue without waiting.  What is the best way to do this?

0 Kudos
3 Replies
andrew_4619
Honored Contributor II
359 Views

You can issue a command to the commandline using createprocess from the win api without waiting for it to finish.

If you are deleteing using fortran commands/routines you need a new thread....

0 Kudos
jimdempseyatthecove
Honored Contributor III
359 Views

You can run a program named "start", with either an application or batch file.

From cmd window, issue "start /?" to get the list of options.

Then from your FORTRAN program you can issue the command with the appropriate options and arguments.

Jim Dempsey

0 Kudos
dajum
Novice
359 Views

Thanks Jim!  Just what I was looking for.

0 Kudos
Reply