Changed write mode for fopen to append when writing incoming file