I'm looking for a way to retrieve files newer than a certain date/time on an SMB remote share, all working under Windows. I've been using DirectoryInfo.EnumerateFiles(), and filtering as they are returned. Unfortunately, this means every file record is being sent over the network before I look at it, and as the file list grows, this gets progressively worse.
I'm stuck working with a third party vendor such that I don't have the option of removing old files, and I can't run any code on the file server I'm reading from.
I've been able to get some temporary improvement by p/invoking FindFirstFileEx/FindNextFile and using the FindExInfoBasic and FIND_FIRST_EX_LARGE_FETCH flags, but ideally, I'd like to offload the datetime filter to the server and only send the file records I need over the network. Is there some API I'm just not finding that could help?