View Full Version : Delete files older than a certain date
7th August 2008, 19:25
As part of our install process, we have a utility that backs up our database info, and some report files. When installing our new product, we only need to keep report files that are less than a year old, and removing the older files speeds up our install significantly.
Is there a way to delete files out of a directory based on a wildcard search, and could they be searched quickly using their creation dates?
7th August 2008, 21:28
I think you should be able to use the Locate (http://nsis.sourceforge.net/Docs/AppendixE.html#E.1.2) macro. This same documentation is also included in your NSIS help file.
8th August 2008, 15:07
But locate can only really find files based on their existence or size.
Would you suggest trying to use something like the Time plugin in the callback function? That would mean the callback would be used on every file, and that seems pretty inefficient.
8th August 2008, 15:20
a Locate / GetTime (http://nsis.sourceforge.net/Docs/AppendixE.html#E.1.6) combo should do it
vBulletin® v3.8.6, Copyright ©2000-2013, Jelsoft Enterprises Ltd.