See ClearFileCache (http://masm32.com/board/index.php?topic=94.msg72735#msg72735).
FindFirstFile is the only viable way. It's not that slow, actually, provided the info is already in the cache.
You have the FlushFileBuffers
Quote from: AW on August 22, 2018, 10:47:20 PM
You have the FlushFileBuffers
You have ideas :t
How would you use it?
I have used it only with pipes. I have no clear scenario to use it with files or folders - usually the cache is pretty intelligent. However, in a particularly busy system, we may need to force it to flush right away.
Quote from: AW on August 23, 2018, 05:33:05 AMI have no clear scenario
I have a testbed (loops=1000):
NanoTimer()
For_ ct=0 To loops-1
Open "U", #1, edi
invoke FlushFileBuffers, MbFH[4]
Let esi=Input$(#1, Min(MbBufSize/4, Lof(#1)))
Close #1
Next
Inkey NanoTimer$(), " for FlushFileBuffers & file read"67 ms for cached file read
3565 ms for ClearFileCache + file read
417 ms for FlushFileBuffers & file read