Filter files (via a file mask) whose filenames are lower than something (e.g <*2024-11-09*)

Advertisement

King555
Guest

Filter files (via a file mask) whose filenames are lower than something (e.g <*2024-11-09*)

I always used this as a file mask for filtering files on an SFTP storage: <*2024-11-09*

This showed me all the files whose filenames (not dates!) were before *2024-11-09*, e.g. backup_2024-11-08.tar.

Now this does not work anymore, the mask is invalid and I get an error message. The documentation also tells me that is is not possible.

First question: When did this behaviour change? There is nothing in the changelog.

Second question: How do I achieve what I'm trying to do? I need to delete a lot of files. I cannot use the date, because the upload date is not always the backup date (due to errors on my server's side).

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
42,505
Location:
Prague, Czechia

Re: Filter files (via a file mask) whose filenames are lower than something (e.g <*2024-11-09*)

It is not possible and it never was.

Is this about GUI or scripting?

Reply with quote

King555
Guest

I knew this reply would come. 😉

I can guarantee that I used this file mask without an error message for years. I even have it dozens of times in my history for that input field. I can only imagine that the asterisks were ignored a few versions ago, which means <*2024-11-09* was identical to <2024-11-09 (and that would mean that I always filtered for the file date).

And it's about the GUI.

Is there any other way to achieve my goal (with WinSCP)?

Reply with quote

King555
Guest

Sorry for double posting, but I cannnot edit as a guest. I just checked WinSCP version 6.3.6 and I do not get an error message there! So there was a change in any way.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
42,505
Location:
Prague, Czechia

Ok, indeed before 6.4.1, the <*2024-11-09* was interpreted the same way as <2024-11-09 – i.e. as a time constraint – not the way you want.
This unwanted and undocumented behaviour (which I didn't even know about until now) was lost with upgrade to a new compiler/IDE in 6.4.1.
Now the <*2024-11-09* is correctly considered invalid. As it should have always been.

Reply with quote

Advertisement

King555
Guest

Thanks! Now at least the "why" is answered, only the "how" remains. 😉 I guess there is no workaround in WinSCP itself.

Reply with quote

Advertisement

You can post new topics in this forum