Also support an already opened file (instead of just using a filename)