Generalized some file system operations.