add open function to file.cu