#1543 closed Bug (No Bug)
DirMove behaviour
| Reported by: | 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 , 16 years ago
comment:2 by , 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 , 16 years ago
| Resolution: | → No Bug |
|---|---|
| Status: | new → closed |
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 , 16 years ago
1) very odd indeed.
2) should have bin closed after first message(not mine) in my view. :p
comment:5 by , 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. ;)

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.