Why is that better? Seems like that's asking the user of the library to do a little bit more work, and gives them more opportunity to mess up (e.g. by trying to open the file with the wrong mode).