Page 1 of 1

Delete files modified before another file

PostPosted: 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.

Re: Delete files modified before another file

PostPosted: Thu Jul 08, 2021 10:14 am
by Mr_Noodle
How about doing "Date create/modified is not among the 1 most recent"?

Re: Delete files modified before another file

PostPosted: 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.

Re: Delete files modified before another file

PostPosted: Mon Jul 12, 2021 9:06 am
by Mr_Noodle
Can you give me a specific example with full names and locations of the files in question?

Re: Delete files modified before another file

PostPosted: 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

Re: Delete files modified before another file

PostPosted: 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.

Re: Delete files modified before another file

PostPosted: 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.