Added file_open().

Added a function that will open the input file int he right way depending on whether the user wants to overwrite the original file or not.