Use C-style file I/O instead of streams

Signed-off-by: Thorben Hasenpusch <thorben.hasenpusch@gmail.com>