Move the temporary file to the target location.
545427
def commit(self, f):
        ''''''
        if self._overwrite:
            replace_atomic(f.name, self._path)
        else:
            move_atomic(f.name, self._path)
894684
def move_file(src_root_path, src_path, dst_root_path, dst_path, action = 'move')
      # Entry point
      url = "#{@client.app_info[:launcher_server]}#{API_VERSION}/nfs/movefile"

      # Payload
      payload = {}
      payload["srcRootPath"] = src_root_path # 'app' or 'drive'
      payload["srcPath"] = src_path
      payload["destRootPath"] = dst_root_path # 'app' or 'drive'
      payload["destPath"] = dst_path
      payload["action"] = action

      # API call
      uri = URI(url)
      http = Net::HTTP.new(uri.host, uri.port)
      req = Net::HTTP::Post.new(uri.path, {
        'Authorization' => "Bearer #{@client.key_helper.get_valid_token()}",
        'Content-Type' => 'application/json'
      })
      req.body = payload.to_json
      res = http.request(req)
      res.code == "200" ? true : JSON.parse(res.body)
    end
1054784
def movefile(source_path, dest_path, make_parents=False, backup_suffix=None):
  
  if make_parents:
    make_parent_dirs(dest_path)
  move_to_backup(dest_path, backup_suffix=backup_suffix)
  shutil.move(source_path, dest_path)
694111
function move(oldPath, newPath) {
  if (toDel[oldPath] || !fileExists(oldPath)) {
    log('Error: no file to move: ', 'red', oldPath);
    throw new Error('No file to move');
  }

  if (fileExists(newPath)) {
    log('Error: target file already exists: ', 'red', newPath);
    throw new Error('Target file already exists');
  }
  if (fileLines[oldPath]) {
    fileLines[newPath] = fileLines[oldPath];
    delete fileLines[oldPath];
  }

  // if (asts[oldPath]) {
  //   asts[newPath] = asts[oldPath];
  //   delete asts[oldPath];
  // }

  if (toSave[oldPath]) {
    toSave[newPath] = true;
    delete toSave[oldPath];
  }

  if (toDel[oldPath]) {
    delete toDel[oldPath];
  }
  // if the file has already been moved
  oldPath = _.findKey(mvs, s => s === oldPath) || oldPath;
  mvs[oldPath] = newPath;
}
419721
function move( $dstPath )
    {
        $srcPath = $this->filePath;

        eZDebugSetting::writeDebug( 'kernel-clustering', "fs::move( '$srcPath', '$dstPath' )", __METHOD__ );

        eZDebug::accumulatorStart( 'dbfile', false, 'dbfile' );
        eZFileHandler::move( $srcPath, $dstPath );
        eZDebug::accumulatorStop( 'dbfile' );
    }
1219086
def remove_temporary_source(self):
        """"""
        if self.is_bundle or os.path.exists(self.delete_marker_filename):
            logger.info('Removing source in %s' % self.source_dir)
            if self.source_dir:
                rmtree(self.source_dir)
            self.source_dir = None
        if self._temp_build_dir and os.path.exists(self._temp_build_dir):
            rmtree(self._temp_build_dir)
        self._temp_build_dir = None
1077779
def move(self, key, folder):
        
        # Basically this is a sophisticated __delitem__
        # We need the path so we can make it in the new folder
        path, host, flags = self._exists(key)
        self._invalidate_cache()

        # Now, move the message file to the new folder
        newpath = joinpath(
            folder.base, 
            folder.get_name(), 
            "cur",     # we should probably move it to new if it's in new
            basename(path)
            )
        self.filesystem.rename(path, newpath)
        # And update the caches in the new folder
        folder._invalidate_cache()
1156124
private void moveTaskOutputs(TaskAttemptContext context,
                               FileSystem fs,
                               Path jobOutputDir,
                               Path taskOutput) 
  throws IOException {
    TaskAttemptID attemptId = context.getTaskAttemptID();
    context.progress();
    if (fs.isFile(taskOutput)) {
      Path finalOutputPath = getFinalPath(jobOutputDir, taskOutput, 
                                          workPath);
      if (!fs.rename(taskOutput, finalOutputPath)) {
        if (!fs.delete(finalOutputPath, true)) {
          throw new IOException("Failed to delete earlier output of task: " + 
                                 attemptId);
        }
        if (!fs.rename(taskOutput, finalOutputPath)) {
          throw new IOException("Failed to save output of task: " + 
        		  attemptId);
        }
      }
      LOG.debug("Moved " + taskOutput + " to " + finalOutputPath);
    } else if(fs.getFileStatus(taskOutput).isDir()) {
      FileStatus[] paths = fs.listStatus(taskOutput);
      Path finalOutputPath = getFinalPath(jobOutputDir, taskOutput, workPath);
      fs.mkdirs(finalOutputPath);
      if (paths != null) {
        for (FileStatus path : paths) {
          moveTaskOutputs(context, fs, jobOutputDir, path.getPath());
        }
      }
    }
  }
120100
def temporary_dir():
    
    d = tempfile.mkdtemp()
    try:
        with cd(d):
            yield d
    finally:
        if os.path.exists(d):
            shutil.rmtree(d)
959086
def on_close(self, filename):
        """"""
        shutil.move(filename, self.destination_folder)
        path, fn = os.path.split(filename)
        return os.path.join(self.destination_folder, fn)
467064
def do_action(self, target, dry_run=False):
        
        # Get full path to the file in the destination directory
        new_filename = os.path.join(self.destination, os.path.basename(target))

        # If the file exists in the destination directory, append _NNN to the name where NNN is
        # a zero padded number. Starts at _001
        while os.path.exists(new_filename):
            # if filename ends in _NNN, start at that number
            filename, extension = os.path.splitext(os.path.basename(new_filename))
            if filename[-4] == '_' and filename[-3:].isdigit():
                # Split the number off the filename and increment it, handle suffixes longer than 3 numbers
                current = filename.split('_')[-1]
                filename_root = filename[0:-len(current)-1]
                current = int(current) + 1
                new_filename = os.path.join(self.destination,
                                            (filename_root +
                                             "_{0:03d}".format(current) +
                                             extension))
            else:
                # No number suffix found in the filename, just start at _001
                new_filename = os.path.join(self.destination,
                                            (filename + "_001" + extension))

        if dry_run is False:
            self.logger.debug("Moving {0} to {1}".format(target, new_filename))

            if not os.path.exists(new_filename):
                try:
                    shutil.move(target, new_filename)
                except IOError:
                    self.logger.error("Error moving file {0} to {1}".format(target, self.destination))
                    raise IOError
            else:
                self.logger.error("Destination file already exists: {0}".format(new_filename))
                raise IOError

            return new_filename

        else:
            self.logger.debug("Dry run. Skipping move {0} to {1}".format(target, new_filename))
            return target
172084
public static void move(String srcPath, String dstPath) throws IOException {
    Files.move(Paths.get(srcPath), Paths.get(dstPath), StandardCopyOption.REPLACE_EXISTING);
  }
16268
private static void moveFile(final File fromFile, final File toFile) throws UpdateException {
        try {
            // Create parent directory structure if necessary
            FileUtils.mkParentDirs(toFile);
            Files.move(fromFile.toPath(), toFile.toPath(),
                    StandardCopyOption.REPLACE_EXISTING);
        } catch (IOException ioe) {
            throw new UpdateException("Unable to move temporary file to destination file: " +
                    fromFile + " -> " + toFile + ": " + ioe.toString());
        }
    }
764055
def move_safe(origin, target):
    
    if origin == target:
        return origin
    if file_exists(target):
        return target
    shutil.move(origin, target)
    return target
330097
def file_move(filename, settings):
        
        if len(settings) != 1:
            raise ValueError("Settings must only contain one item with key "
                             "'dest'.")
        for k, v in settings.items():
            if k == "dest":
                shutil.move(filename, v)
1007702
def move(self, path, raise_if_exists=False):
        
        self.fs.move(self.path, path, raise_if_exists)
1120985
@Override
    public T move(String source, String target) throws IllegalArgumentException, IllegalArchivePathException {
        this.getArchive().move(source, target);
        return covarientReturn();
    }