Added some functions to open and extract a file.

Added some functions to open and extract a file. Need to check if output is defined and If so, Iff it is a valid dir.