Read and write are 95% working

The data entered via fprintf can't be read back correctly for some reason though...