Change to std::FILE and binary file mode.
Remove unused iostreams.