base file read code