Modify

Opened 10 years ago

Closed 10 years ago

#825 closed Feature Request (Rejected)

Change the behaviour of DirMove()

Reported by: MrCreatoR <mscreator@…> Owned by:
Milestone: Component: AutoIt
Version: Severity: None
Keywords: DirMove Overwrite Cc:

Description

Hi,

I found that DirMove() having problem (limitation?) when trying to move directory with overwrite flag.

Let's say we want to move «C:\Source» to «C:\Dest» and overwrite all existing files & folders, source dir includes some files and folders, and also destination dir having files and folders in it. Now we trying to move:

DirMove("C:\Source", "C:\Dest", 1)

What we get, is that «Source» directory moved to «C:\Dest\», and not as a content, but as whole root folder.

For now, the only way to move the content of «Source» directory, is to copy it first, and then delete the source, like this:

DirCopy("C:\Source", "C:\Dest", 1)
DirRemove("C:\Source")

but it's take more time, and more operations.

So i only proposing to change the behaviout of DirMove; if we use 1 as third parameter (overwrite files), just move the content of the source directory, if users want to put it inside as a folder, they just do this:

DirMove("C:\Source", "C:\Dest\Source", 1)

P.S
And i know about the note in help file, i just think that this is wrong behaviour.

Attachments (0)

Change History (3)

comment:1 Changed 10 years ago by Valik

  • Resolution set to No Bug
  • Status changed from new to closed

The current behavior is consistent with the move command on the command line. I don't think there is anything wrong with the current behavior, either. I think there is a misunderstanding about what you are trying to do. You are not trying to move the source folder to the existing destination folder, you're trying to move the contents of the source folder to the existing destination folder. This a different operation than trying to rename or relocate a folder.

There is no single operation that can do what you want though it is trivial to write a UDF to do it.

comment:2 Changed 10 years ago by Valik

  • Milestone Future Release deleted
  • Resolution No Bug deleted
  • Status changed from closed to reopened
  • Version 3.3.0.0 deleted

I just noticed this was a feature request. Please read WikiStart, particularly the parts about setting milestones and versions.

comment:3 Changed 10 years ago by Valik

  • Resolution set to Rejected
  • Status changed from reopened to closed

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The ticket will remain with no owner.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.