GeoEco.DataManagement.Directories.Directory.Move

classmethod Directory.Move(sourceDirectory, destinationDirectory, deleteExistingDestinationDirectory=False, overwriteExistingFiles=False)

Moves a directory, including its subdirectories and files.

Parameters:
  • sourceDirectory (str) – Directory to move. The directory may contain subdirectories and files. Other types of file system objects, such as symbolic links, are not allowed. Minimum length꞉ 1. Must exist.

  • destinationDirectory (str) –

    New path for the directory.

    If the destination directory is on the same drive or file system as the source directory, the source directory will simply be renamed to the destination directory.

    If the destination directory is on a different drive or file system, the source directory will be copied to the destination directory and then deleted.

    Minimum length꞉ 1. Must be different than sourceDirectory.

  • deleteExistingDestinationDirectory (bool, optional) – This parameter is ignored if the destination directory does not already exist. If True, the existing destination directory, including all subdirectories and files, will be deleted and replaced with the source directory. If False, the destination directory will not be deleted first, and the files in the source directory (and all subdirectories) will be moved into the existing destination directory.

  • overwriteExistingFiles (bool, optional) – If True, destination files will be overwritten, if they exist. If False, a ValueError will be raised if any destination file exists. This parameter is ignored if deleteExistingDestinationDirectory is True, since that parameter will cause any existing files to be deleted.