Minor changes of the api of this module. FILE* argument added