Implement open file method.