Moved mmap into openAndMap to consolidate code.