working on file I/O primitives