abstract readFile/writeFile