Asynchronous file I/O has been a feature of .NET from Version 1.1 onwards. However, the loops that the developer had to run to get it working were many. In Version 4.5, .NET introduced a new API that would make using asynchronous file operation easy. At the core of the API, we have two operators—
await. This recipe will focus on using these operators to implement an asynchronous directory-to-directory copy utility.
The following steps will help you perform directory-to-directory copy using asynchronous file I/O: