Are you sure that /Users/iainduncan/from-s4m.txt is not a directory? s7 just calls fopen with the desired name (and mode), and if that call fails, uses strerror to report what happened -- about as simple as IO can get. I tried both Linux and OSX cases, and had no problems with hyphens.