in reply to Appending to a file.
Maybe over the past three decades I have become known as “the odd man out,” but if that be so, then so be it. It seems to me that you are approaching this file, registration.dat, as though it had somehow become a tablet fixed in stone, writ by the hand of a god. Could this “flat file” have at this point become ... a database? If so, then perhaps the instant requirement is merely a bellwether of a larger and more generalized case? Perhaps this registration file should as quickly as possible become a registration database table ... which any software process (anywhere in the enterprise, on any platform) could now simultaneously update.
If this is indeed the case, then you will have instantaneously replaced the extant question of “how did the chicken cross the road?” by the installation of a full-featured antimatter transporter network.