Initial file opening functionality.