Add open file function.