Is there an async version of DirectoryInfo.GetFiles / Directory.GetDirectories in dotNet?

前端 未结 7 2099
北荒
北荒 2020-12-08 06:50

Is there an asynchronous version of DirectoryInfo.GetFiles / Directory.GetDirectories in dotNet? I\'d like to use them in an F# async block, and it\'d be nice to have a ver

7条回答
  •  时光说笑
    2020-12-08 07:07

    Actually, according to the help for Directory.GetFiles, Directory.EnumerateFiles will return the first result immediately (it's an IEnumerable), rather than wait for the entire list before returning. I believe that's probably what you're looking for.

提交回复
热议问题