in reply to How do I restore STDOUT

You should always test the return value of any system call, in particular open. If you do, you'll see that both open calls are failing.

The & in the file name is probably causing your failure, although a number of other things could be wrong (permissions, etc.)

Originally posted as a Categorized Answer.