jrhutch
7th August 2008 20:25 UTC
Delete files older than a certain date
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?
Comperio
7th August 2008 22:28 UTC
I think you should be able to use the Locate macro. This same documentation is also included in your NSIS help file.
jrhutch
8th August 2008 16:07 UTC
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.
Yathosho
8th August 2008 16:20 UTC
a Locate / GetTime combo should do it