Some fixes of bin cdx read, much for cdx bin write

Most infrastructure for file write

Signed-off-by: Lennard Wasserthal <Wasserthal@nefkom.net>