My guess is after switching a lot of the write stuff over to actually using streams like in C++, as mIRC is written in C++, he made some mistake that allows for the stream not to close correctly. The file is still open when something else tries to write in it, and because Windows protects the file from being accessed no further writes can be done. Which explains why when the error hits once it hits a lot of times. The file gets locked open.