Make the program write_connect more portable.