Abstracting file functions.