I just realized that Arc uses 'text mode with outfile... but that breaks on Windows if the file you're writing to isn't a regular file. Even worse, there's no way to specify 'binary from within Arc.
It does, however, allow Arc to pretend that "everything is Unix" since 'text mode automatically converts "\n" to "\r\n" on Windows. But infile uses 'binary mode, so in that case it should probably use 'text mode too, to maintain the illusion.
Alternatively, make outfile use 'binary mode. Just so long as outfile and infile are consistent and agree with each other.