Well, this will still end up throwing an exception if filename is for instance "ab".