Modify

Opened 17 years ago

Closed 17 years ago

Last modified 3 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 (5)

comment:1 by Valik, 17 years ago

Resolution: No Bug
Status: newclosed

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 by Valik, 17 years ago

Milestone: Future Release
Resolution: No Bug
Status: closedreopened
Version: 3.3.0.0

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

comment:3 by Valik, 17 years ago

Resolution: Rejected
Status: reopenedclosed

comment:4 by anonymous, 3 years ago

We need DirRename function

in reply to:  4 comment:5 by Jos, 3 years ago

Replying to anonymous:

We need DirRename function

...because? What is wrong with using DirMove() for that?

Modify Ticket

Action
as closed The ticket will remain with no owner.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.