Add function to determine output extensions

Adds the function to determine the output extension for a given file path.