remember to set the close function for rwops