making file I/O platform and os agnostic