Thanks for the reply Arturo!
Indeed it works. However, on this way I would need to create an instance of ofFile each time I want to send a string to the text file? Plus, I have tested calling that twice in a roll, and it does not work for the second time already that it is called. The context is: I have a function that I call on update() each time I need to record to a text file a string.