<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _perform_file_action(self, filename, action):
 """Perform action on specific file types. Dynamic dispatch function for performing actions on specific file types. """

        ext = os.path.splitext(filename)[1]
        try:
            func = getattr(self, '_{}_{}'.format(action, ext[1:]))
        except AttributeError:
            raise Exception('Unsupported file type {}'.format(ext[1:]))
        func(filename)