Only get files younger than t

67 Views Asked by At

Is there a way to get only the files out of a directory which are younger than a specific age?

So this method will produce this result, but it will get all files first and then disregard those who dont fit, which is quite inefficient.

Dim Files = dir.GetFiles().Where(Function(x) x.LastWriteTime >= ts) 'dir: DirectoryInfo, ts: DateTime

0

There are 0 best solutions below