Some file related utility functions and variations of internal functions which take callbacks.