'handler for file transfer operations'

def run(self, tmp=None, task_vars=None):

    if (task_vars is None):
        task_vars = dict()
    result = super(ActionModule, self).run(tmp, task_vars)
    if (not tmp):
        tmp = self._make_tmp_path()
    creates = self._task.args.get('creates')
    if creates:
        if self._remote_file_exists(creates):
            self._remove_tmp_path(tmp)
            return dict(skipped=True, msg=('skipped,    since    %s    exists' % creates))
    removes = self._task.args.get('removes')
    if removes:
        if (not self._remote_file_exists(removes)):
            self._remove_tmp_path(tmp)
            return dict(skipped=True, msg=('skipped,    since    %s    does    not    exist' % removes))
    chdir = self._task.args.get('chdir')
    if chdir:
        if ((self._connection._shell.SHELL_FAMILY == 'powershell') and (not self.windows_absolute_path_detection.matches(chdir))):
            return dict(failed=True, msg=('chdir    %s    must    be    an    absolute    path    for    a    Windows    remote    node' % chdir))
        if ((self._connection._shell.SHELL_FAMILY != 'powershell') and (not chdir.startswith('/'))):
            return dict(failed=True, msg=('chdir    %s    must    be    an    absolute    path    for    a    Unix-aware    remote    node' % chdir))
    parts = self._task.args.get('_raw_params', '').strip().split()
    source = parts[0]
    args = '    '.join(parts[1:])
    try:
        source = self._loader.get_real_file(self._find_needle('files', source), decrypt=self._task.args.get('decrypt', True))
    except AnsibleError as e:
        return dict(failed=True, msg=to_native(e))
    tmp_src = self._connection._shell.join_path(tmp, os.path.basename(source))
    self._transfer_file(source, tmp_src)
    self._fixup_perms2((tmp, tmp_src), execute=True)
    env_dict = dict()
    env_string = self._compute_environment_string(env_dict)
    script_cmd = '    '.join([env_string, tmp_src, args])
    script_cmd = self._connection._shell.wrap_for_exec(script_cmd)
    exec_data = None
    if (self._connection.transport == 'winrm'):
        exec_data = self._connection._create_raw_wrapper_payload(script_cmd, env_dict)
    result.update(self._low_level_execute_command(cmd=script_cmd, in_data=exec_data, sudoable=True, chdir=chdir))
    self._remove_tmp_path(tmp)
    result['changed'] = True
    if (('rc' in result) and (result['rc'] != 0)):
        result['failed'] = True
        result['msg'] = 'non-zero    return    code'
    return result
