Factored out the file management funtions from GEMDOS