If something like this was implemented, the cached data should be cleared as soon as the routine (alias or event) that called $findfile was finished, otherwise the cache could end up with invalid data (eg if a file is deleted in the meantime).

With this in mind, I can't see much use for it, as found filenames can already be referenced multiple times: either by $1- inside the alias in $findfile(dir,mask,0,alias $1-) or by $line(@win,N) after a $findfile(dir,mask,0,@win). The only case where this could be useful is if you call $findfile(dir,mask,0) (without a 4th parameter) to get the number of all matching files and later (in the same routine) you want to reference a single file (or certain files) by index, for example just get the 3rd and the 5th filename. This is a rather odd scenario though, I have never needed such a thing nor can I think of why anyone would. Can you give an example of a real-world use of such a feature?

On a sidenote, you probably know this already, but caching is already done by the system at the appropriate level, which is why subsequent calls of the same $findfile() are much faster.


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com