#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 Changed 15 years ago by Valik
comment:2 Changed 15 years ago by anonymous
...
;; 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 Changed 15 years ago by Jpm
- Resolution set to No Bug
- Status changed from new to 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 Changed 15 years ago by anonymous
1) very odd indeed.
2) should have bin closed after first message(not mine) in my view. :p
comment:5 Changed 15 years ago by Jpm
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. ;)
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.
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.