pr1351: simplified file functions