Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs have moved to the Altera Community. Existing Intel Community members can sign in with their current credentials.

Deleting old files

michael_green
Beginner
470 Views
I would like to be able to delete all the files in a specified directory that are more than 7 days old. I've been given an example of a VB program that can do this sort of thing but am unable to work out the equivalent in Visual Fortran. Does anyone know how to do this?

With many thanks in advance,

Mike
0 Kudos
1 Reply
Jugoslav_Dujic
Valued Contributor II
470 Views

DFLIB:

FINDFILEQQ / GETFILEINFOQQ / DELFILESQQ

Win32:

FindFirstFile / FindNextFile / DeleteFile / FindClose

I believe you'll find some samples on the Forum for the latter (additionally,you'll have to test WIN32_FIND_DATA.ftCreationTime,cast it to an integer(8)and perform 64-bit arithmetics. See also GetLocalTime, SystemTimeToFileTime).
Jugoslav
0 Kudos
Reply