To modify a pointer, you need a pointer to a pointer.

One of your functions needs to receive a FILE** parameter.