If you intend to write to the file several times, it would be better to save the handle returned by CreateFile (). Creating a kernel descriptor in a file will always be more inefficient if reusing the old descriptor (ceteris paribus), but there may be other considerations to consider. As always, you need to measure performance before and after to do this optimization.
source
share