Resolution:
Open the file in the relevant access mode and then retry the unsuccessful file operation.