Page 1 of 1 1
Topic Options
#145296 - 2005-08-11 02:09 AM Move not overwriting when using UNC Path as destination
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
Using KiXtart 2010 4.50
Code:

Break On
Move "D:\MyFolder\MyFile1.txt" "\\MyComputer\MyShare"
? @ERROR ": " @SERROR
Copy "D:\MyFolder\MyFile2.txt" "\\MyComputer\MyShare"
? @ERROR ": " @SERROR
Move "D:\MyFolder\MyFile2.txt" "\\MyComputer\MyShare"
? @ERROR ": " @SERROR


The kix2010 manual tells for the "Move" command that:
Quote:


MOVE overwrites existing files without warning.




But when moving to an UNC style path and when the destination file exists, the file is not overwritten. The Error Code is 80, telling it exists.

Top
#145297 - 2005-08-11 05:54 AM Re: Move not overwriting when using UNC Path as destination
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
The manual also states
Quote:


If the source or target specifies a directory, please make sure to add a trailing backslash




which you forgot. You're now tryig to write a file under the same location as an already existing folder. As windows does not allow this, an error message is generated and the action is not beign performed. This is the correct and desired behavior. Thus, it is a coding error in your code, not a KiXtart or windows bug.
_________________________
There are two types of vessels, submarines and targets.

Top
#145298 - 2005-08-11 07:57 AM Re: Move not overwriting when using UNC Path as destination
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
Code:

Break On
Move "D:\MyFolder\MyFile1.txt" "\\MyComputer\MyShare\"
? @ERROR ": " @SERROR
Copy "D:\MyFolder\MyFile2.txt" "\\MyComputer\MyShare\"
? @ERROR ": " @SERROR
Move "D:\MyFolder\MyFile2.txt" "\\MyComputer\MyShare\"
? @ERROR ": " @SERROR


You are right, but I see no difference.
In my example, the destination path exists.


Edited by Witto (2005-08-11 07:59 AM)

Top
#145299 - 2005-08-11 04:28 PM Re: Move not overwriting when using UNC Path as destination
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
so, jens, this is a kixtart issue, no?
_________________________
!

download KiXnet

Top
#145300 - 2005-08-29 08:11 PM Re: Move not overwriting when using UNC Path as destination
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
This feature is still available in "KiXtart 2010 4.51 Beta 1"
Top
#145301 - 2005-09-28 12:47 AM Re: Move not overwriting when using UNC Path as destination
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
Also "KiXtart 2010 4.51 Release Candidate 1" is not overwriting when moving to a UNC style path.
Top
#145302 - 2005-09-29 09:39 PM Re: Move not overwriting when using UNC Path as destination
iffy Offline
Starting to like KiXtart

Registered: 2005-05-29
Posts: 149
Loc: The Netherlands
Sealeopard, what version where you using when testing this? Or did you simply quote from the manual? I've also done some quick testing with 4.50 and come to the same conclusion as the topic starter. So it appears not to be a RTFM issue afterall...

The line in the documentation about the trailing backslash is obviously meant when moving directories and not for files.

The overwriting comment is for doing something like this:
Code:
Move "D:\MyFolder\MyFile2.txt" "D:\MyFolder\MyFile3.txt"


The above does overwrite without warning.

So we have:
a) a bug
b) a minor documentation error

"If the source or target specifies a directory, please make sure to add a trailing backslash."

Should be something like:

"When moving directories, please make sure to add a trailing backslash."

Nice double catch Witto.


Edited by iffy (2005-09-29 09:40 PM)

Top
#145303 - 2005-09-29 09:55 PM Re: Move not overwriting when using UNC Path as destination
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
moved the thread from suggestions to beta and asked ruud to comment on this.
_________________________
!

download KiXnet

Top
#145304 - 2005-11-29 03:25 PM Re: Move not overwriting when using UNC Path as destination
Karl Napp Offline
Fresh Scripter

Registered: 2003-04-10
Posts: 5
Cannot move folders over Shares

Hello!

I run into some difficulties when I try to move folders:

This code works:
Code:
 $src="c:\tmp\sourcefolder\"
$dest="c:\tmp\Destination\"
Move $src $dest



This one doesn't:
Code:
 $src="\\server\share1\sourcefolder\"
$dest="\\server\share2\"
Move $src $dest



Error number and message are:
Quote:

ERROR 123: The filename, directory name, or volume label syntax is incorrect.




I tried it with COM:
Code:
$fso = CreateObject("Scripting.FileSystemObject")
$err=$fso.MoveFolder($src, $dest)
$fso=0



and get no error in both cases (local and remote move) - but nothing happens...

Can somebody please push me in the right direction? I prefer working with Shares.

Thank you very much in advance.

Top
#145305 - 2005-11-30 01:07 AM Re: Move not overwriting when using UNC Path as destination
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
Does the MOVE command work from the commandline? I suspect it's not a KiXtart issue as even the COM object fails.
_________________________
There are two types of vessels, submarines and targets.

Top
#145306 - 2005-12-31 02:08 AM Re: Move not overwriting when using UNC Path as destination
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
Also 4.52 Beta1 not overwriting the target if
  • the target exists
  • the target is to be found via an UNC path

Code:

Break On
$ = Open(1, "C:\Test1.txt", 1)
$ = Close(1)
$ = Open(1, "C:\Test2.txt", 1)
$ = Close(1)
Move "C:\Test1.txt" "\\"+@WKSTA+"\C$\Test2.txt"
? @ERROR ": " @SERROR
? @KIX


Top
#145307 - 2006-08-02 06:00 PM Re: Move not overwriting when using UNC Path as destination
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
Move is still not overwriting in Kix32 4.52 and 4.53 Beta 1.
Top
#145308 - 2006-08-03 02:01 PM Re: Move not overwriting when using UNC Path as destination
Ruud van Velsen Moderator Offline
Developer
*****

Registered: 1999-05-06
Posts: 391
Loc: Amsterdam, The Netherlands
Thanks for the report. MOVE indeed still has an issue with overwriting existing files if the target was a UNC. As it turns out, the underlying API returns a different resultcode for files accessed via a UNC.

This is addressed in the next build of 4.53.

Good one, thanks!

Ruud

Top
#145309 - 2006-08-03 04:37 PM Re: Move not overwriting when using UNC Path as destination
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
Thanks,
I appreciate all input that was given and I look forward to the new version.

Top
#145310 - 2006-08-11 01:34 AM Re: Move not overwriting when using UNC Path as destination
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
4.53 Beta 2 solved it. Thank you!
Top
Page 1 of 1 1


Moderator:  ShaneEP, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 507 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.065 seconds in which 0.025 seconds were spent on a total of 12 queries. Zlib compression enabled.