Modify

Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#1543 closed Bug (No Bug)

DirMove behaviour

Reported by: mrflipp@… Owned by:
Milestone: Component: AutoIt
Version: 3.3.6.0 Severity: None
Keywords: Cc:

Description

I use the function "dirMove" to copy a directory called "\sourceparentdir\directoryname" [1] to another directory called "\destinationparentdir\directoryname" [2].

The expected behaviour would be that (with overwrite flag set) the files and subfolders in the source folder would be moved to the destination folder. But the function stores the folder "directoryname" IN the dstination folder "directoryname", so that "\destinationparentdir\directoryname\directoryname" is the result.

OS: Windows 7 x64

Attachments (0)

Change History (5)

comment:1 by Valik, 16 years ago

Good to see you can't see the big bright red box. Either submit a proper bug report or don't waste everyone's time.

comment:2 by anonymous, 16 years ago

...

;; run script more than one time.
;; 1) \Target
;; 2) \Target\Source
;; 3) \Target\Source\Source (etc)
;; Running:(3.3.6.1), Environment(Language:0409  Keyboard:00000409  OS:WIN_XP/Service Pack 3  CPU:X86 OS:X86)

$sPathSource = @ScriptDir & '\Source'
$sPathTarget = @ScriptDir & '\Target'

If FileExists($sPathSource) And Not DirRemove($sPathSource, True) Then exit 2
;~ If FileExists($sPathTarget) And Not DirRemove($sPathTarget, True) Then exit 3

If Not DirCreate($sPathSource) Then Exit 4
If Not FileWrite($sPathSource & '\file.tmp', 'qwert') Then Exit 5

pause('DirMove' & @CRLF & $sPathSource & @CRLF & $sPathTarget)
If Not DirMove($sPathSource, $sPathTarget, True) Then Exit 61
If Not DirMove($sPathSource, $sPathTarget, True) Then Exit 62

Func pause($sMsg = '')
	If MsgBox(1, 'pause', $sMsg) <> 1 Then Exit 9
EndFunc

comment:3 by J-Paul Mesnage, 16 years ago

Resolution: No Bug
Status: newclosed

Did you reread the doc

If the destination already exists and the overwrite flag is specified then the source directory will be moved inside the destination.

I know it can be seen as funny but it was a old time design decision

comment:4 by anonymous, 16 years ago

1) very odd indeed.
2) should have bin closed after first message(not mine) in my view. :p

comment:5 by J-Paul Mesnage, 16 years ago

It should have been closed with "no respect of ticket writing".
The post of anonymous was really what is needed.
Don't expect that we can rewrite a repro script isolating the behavior as you can do.
Anyway see you on another one. ;)

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.