I want to use “List Storage Files” to show only those files that are older than a certain date. This is so that I can delete files that are older than x number of days.
I see there is an option to use “Filter” that accepts a Microsoft FileSystemGlobbing Matcher.
How can I use this Filter to show me only files that are older than X days?
The filter would work only on names and not on the creation date or so…
So as you know the cut off date…in a loop you can list the files based on date and for each date delete the files till you dont find any old files in it…
(from x in ListStorageFilesOutVar
Let f = x.FileFullPath
Let s = System.Text.RegularExpressions.Regex.Match(f,strPattern).Value
Let d = DateTime.ParseExact(s, "dd-MM-yyyy-HH-mm-ss", System.Globalization.Cultrueinfo.InvariantCulture)
Where d <= FilterDate
Select v=x).toList