Old 7th August 2008, 19:25   #1
jrhutch
Junior Member
 
Join Date: Feb 2008
Location: Austin, TX
Posts: 11
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?
jrhutch is offline   Reply With Quote
Old 7th August 2008, 21:28   #2
Comperio
Major Dude
 
Comperio's Avatar
 
Join Date: Jan 2005
Location: Oregon Coast
Posts: 737
I think you should be able to use the Locate macro. This same documentation is also included in your NSIS help file.
Comperio is offline   Reply With Quote
Old 8th August 2008, 15:07   #3
jrhutch
Junior Member
 
Join Date: Feb 2008
Location: Austin, TX
Posts: 11
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.
jrhutch is offline   Reply With Quote
Old 8th August 2008, 15:20   #4
Yathosho
Forum King
 
Yathosho's Avatar
 
Join Date: Jan 2002
Location: AT-DE
Posts: 3,366
a Locate / GetTime combo should do it
Yathosho is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump