How large are your files? A pretty easy way to read one file then append to another would be
error_log('appending.txt', 3, implode('', file('reading.txt')));
Dunno just how efficent that is or if you need to change the implode to implode("\n"...
, but it's tight and clean if the reading file is small.