This function recreates `os.path.splitext(fileName)[0]`