part 3, functions for listing and opening files