I was wondering if performing an output access on a file located on a cloud storage device (OneDrive, Dopbox, etc...) might generate exceptions at run time especially when the software is doing an automatic buffer flush while the system is syncing the file with the cloud device. Is the file protected from syncing when opening it with the 'DENYRW' sharing attribute whereas the use of 'DENYWR' sharing attribute may be problematic ?
I am observing the same on files stored on network share drive. Deny write occurs randomly and I did not found the cause.
I reccomend to write file locally and then copy it to network drive.