That's just silly. Disk operations are orders of magnitude slower than memory operations. Use strcat or strncat. They work. If you can't get them to work, show THAT code not this grossly over-footprint, underperforming stuff.