Eliminate directory component from input file name to extent possible.