stat method
Retrieves metadata for file with concurrency control.
Wraps File.stat and is useful when scanning many files in parallel.
Implementation
Future<FileStat> stat(File file) async {
await _semaphore.acquire();
try {
return await file.stat();
} finally {
_semaphore.release();
}
}