in reply to Appending two files

It's no part of your code mistakes... but your language needs correction (or, "invited pedantry" if you don't care about being clear and accurate).

You're trying to 'concatenate' two files; not "append" them. You might append a second file to the first (result: two files, the first of which contains the original contents of both), but what you're trying to do is create a third file from the first two.