Add file open function