It would be nice to give a more useful error: * Expected file name but got a folder * File does not exist Maybe some more things we should check ... ?