Delete files modified before another file

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

Delete files modified before another file Wed Jul 07, 2021 8:35 am • by Dave61
I play Civilization a lot. When I start a new game I want all earlier save files to be deleted.

The test is "if file mod date is older than mod date of [AutoSave_Initial_0000 BC-4000.Civ5Save]" but I cannot figure out if this is possible to do in Hazel.
Dave61
 
Posts: 113
Joined: Tue Jul 10, 2012 4:56 pm

Re: Delete files modified before another file Thu Jul 08, 2021 10:14 am • by Mr_Noodle
How about doing "Date create/modified is not among the 1 most recent"?
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Delete files modified before another file Sat Jul 10, 2021 1:39 pm • by Dave61
Mr_Noodle wrote:How about doing "Date create/modified is not among the 1 most recent"?

The autosave file is in a different directory.
Dave61
 
Posts: 113
Joined: Tue Jul 10, 2012 4:56 pm

Can you give me a specific example with full names and locations of the files in question?
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Delete files modified before another file Wed Dec 08, 2021 11:03 am • by Dave61
Mr_Noodle wrote:Can you give me a specific example with full names and locations of the files in question?


The file whose date should be used in the test is:
\saves\auto\AutoSave_Initial_0000 BC-4000.Civ5Save

The other files have names like:
\saves\Augustus_0051 BC-1960.Civ5Save
Dave61
 
Posts: 113
Joined: Tue Jul 10, 2012 4:56 pm

Re: Delete files modified before another file Thu Dec 09, 2021 10:24 am • by Mr_Noodle
With that layout, I'm not sure if that's possible without a script of some sort. That logic is a bit too specialized.
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Delete files modified before another file Thu Dec 09, 2021 12:22 pm • by Dave61
Mr_Noodle wrote:With that layout, I'm not sure if that's possible without a script of some sort. That logic is a bit too specialized.


Thanks.

I have found a solution based on the fact that when a new game cycle starts there are only two files/subfolders in the Auto folder.
Dave61
 
Posts: 113
Joined: Tue Jul 10, 2012 4:56 pm


Return to Support