Perform the write operations inside block on this file. If block throws an exception the write will be failed. Otherwise the write will be applied atomically to the file.