The conversion to c-style string in the filename is necessary, not a problem. If you expect this filename to exist, that should be something you need to check (i.e. that it does exist). Your current working directory may not allow files to be created there, depending on where you're running this from. I wish open would set errno.