Page 1 of 1 1
Topic Options
#181414 - 2007-10-10 09:19 AM Possible copy bug with 4.60?
oneill Offline
Fresh Scripter

Registered: 2005-03-24
Posts: 27
Loc: Australia
Hello All,
I'm trying to copy a file from my domain controller using KIX 4.60 copy command and I've noticed a slight difference between the earlier versions of KIX and the new version of KIX.

If I execute the following code;

@KIX ?
$XLA_Srce = "\\csenergy\netlogon\files\TSJXL9.XLA"
$XLA_Dest = "C:\Documents and Settings\goneill\Application Data\Microsoft\Excel\XLSTART"
$XLA_Srce ?
$XLA_Dest ?
Copy $XLA_Srce $XLA_Dest
'Code (' + @ERROR + ') ' + @SERROR ?

Result:
4.60
\\domain\netlogon\files\TSJXL9.XLA
C:\Documents and Settings\goneill\Application Data\Microsoft\Excel\XLSTART
Code (0) The operation completed successfully.

As you can see from the result it says that the copy was successfully however the file isn't copied. If I run the same code using 4.53 or 4.51 then it works successfully and the file is actually copied.

If I add a backslash "\" to the end of the destination path it works for all versions. e.g.
$XLA_Dest = "C:\Documents and Settings\goneill\Application Data\Microsoft\Excel\XLSTART\"

Is anyone else able to reproduce this behaviour? Is this a bug or is it expected?

thanks.

Top
#181477 - 2007-10-11 04:04 AM Re: Possible copy bug with 4.60? [Re: oneill]
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11162
Loc: Boston, MA, USA
Thishas been the expected behavior for a long time. See the COPY command description in the KiXtart Help file.
 Quote:

Remarks: If the source or target specifies a directory, please make sure to add a trailing backslash.
_________________________
There are two types of vessels, submarines and targets.

Top
#181480 - 2007-10-11 08:44 AM Re: Possible copy bug with 4.60? [Re: Sealeopard]
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
I almost knew this answer would be given. But wouldn't it break many scripts if suddenly the trailing backslash is strict?
At a command prompt, trailing backslashes are never required.

Top
#181489 - 2007-10-11 10:42 AM Re: Possible copy bug with 4.60? [Re: Witto]
oneill Offline
Fresh Scripter

Registered: 2005-03-24
Posts: 27
Loc: Australia
If the trailing backslash is required, why do I then get a successful message? Shouldn't it produce an error?
Top
#181528 - 2007-10-11 09:52 PM Re: Possible copy bug with 4.60? [Re: oneill]
DrillSergeant Offline
MM club member
*****

Registered: 2004-07-09
Posts: 1164
Loc: Eijsden, the Netherlands
I think it's a bug also...

If I execute this code with 4.60 the file test.txt ends up in the folder:
D:\Data\Development\KiXtart\copyerr

If I execute it with 4.52 the file ends up in the folder:
D:\Data\Development\KiXtart\copyerr\test2

 Code:
@KIX ?
$XLA_Srce = "D:\Data\Development\KiXtart\copyerr\test1\test.txt"
$XLA_Dest = "D:\Data\Development\KiXtart\copyerr\test2"
$XLA_Srce ? 
$XLA_Dest ?
Copy $XLA_Srce $XLA_Dest 
'Code (' + @ERROR + ') ' + @SERROR ?


Even if you forget the backslash, it shouldn't be copied to the folder a level lower...

If anyone else agrees, we can put it in the suggestions forum (or beta forum, but since 4.60 is not beta any more this is probably not right)



Edited by DrillSergeant (2007-10-11 09:54 PM)
Edit Reason: lol, I didn't realize it was in the beta forum already...
_________________________
The Code is out there

Top
#181531 - 2007-10-11 10:18 PM Re: Possible copy bug with 4.60? [Re: DrillSergeant]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4648
Loc: The Netherlands
I wonder if this is a side effect (unwanted or not) of the fix for copying a single file to non-existing folder. This fix is first introduced in 4.60 afaik.

 Quote:

....
Enhanced commands, functions, macros
....
COPY - Enhanced to enable copying a single file to a non-existing directory.
....
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#181532 - 2007-10-11 10:32 PM Re: Possible copy bug with 4.60? [Re: DrillSergeant]
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
On page 3 of the kix2010.doc of v4.60, I read
 Quote:

Enhanced commands, functions, macros
...
COPY Enhanced to enable copying a single file to a non-existing directory.

On page 30, I read
 Quote:

COPY
Action
Copies one or more files or directories.

Syntax
COPY "source" "destination" [/h] [/s]

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

but as far as I remember, copy always worked without trailing backslashes. I have the impression that due to the enhancement, this hidden feature has been lost...
Trailing backslashes are also not needed at a command prompt.
I don't know if it can be called a bug, but it is a pity that at once, using or forgetting the trailing backslash maybe breaks some scripts
[Edit]
I see that Mart had the same thought about the cause. Why am I always so late hitting that submit button...
[/Edit]


Edited by Witto (2007-10-11 10:35 PM)
Edit Reason: Too late

Top
#181533 - 2007-10-11 10:43 PM Re: Possible copy bug with 4.60? [Re: Witto]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4648
Loc: The Netherlands
One could want/need to copy a file to a file with no extension like test.txt to test.

Imho copying a file to a folder but not using the last \ should be interpreted as copying a file to a file. If you want to copy to a folder you should always use a trailing \. So imho the current (4.60) behaviour is not correct.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#181534 - 2007-10-11 10:44 PM Re: Possible copy bug with 4.60? [Re: Witto]
DrillSergeant Offline
MM club member
*****

Registered: 2004-07-09
Posts: 1164
Loc: Eijsden, the Netherlands
I can agree with you guys, if the statement:

Copy C:\folder\file.txt C:\folder2

would result in a file called 'folder2' in folder C:\ but that's not what happens. What happens is that it is copied to C:\file.txt and that's unexpected behaviour to say the least.

I also agree with oneill that this is not good for backwards compatibility...



Edited by DrillSergeant (2007-10-11 10:45 PM)
Edit Reason: I'm saying the same as mart, only he found the submit button a bit sooner ;)
_________________________
The Code is out there

Top
#181541 - 2007-10-12 04:20 AM Re: Possible copy bug with 4.60? [Re: DrillSergeant]
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11162
Loc: Boston, MA, USA
The trailing backslash is mentioned in v4.21 on forward for directories. So, it's definitely been there for a while. On the same note a COPY C:\FOLDER\TEXT.TXT D:\FOLDER should thus result in a file called FOLDER in the root of D:\.
_________________________
There are two types of vessels, submarines and targets.

Top
#187689 - 2008-05-16 12:42 AM Re: Possible copy bug with 4.60? [Re: Sealeopard]
MIDAC Offline
Just in Town

Registered: 2006-08-12
Posts: 1
Guys, this is crazy!!! I've spent hours on trying to figure out why my script was copying to the wrong folder. Finally went back to an older version of KIX as that was the only thing that had changed, and lo and behold, it worked fine. So I found this thread... really, these are pretty fundamental changes you are making causing your loyal followers like myself to tear our hair out. And I agree with some poster above, the way it is now is not very intuitive and as to why it dumps stuff in one folder up instead of renaming it to the new name, is also not right.

I also found that the MOVE command seems to have given the same treatment.. I had to add a trailing "/" there too to make it work like before.

Angry Mike

Top
#187696 - 2008-05-16 09:25 AM Re: Possible copy bug with 4.60? [Re: MIDAC]
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4945
Loc: Leatherhead, Surrey, UK
Chill Mike, don't be Angry. KiXtart is too cute to be angry with.

No-one on this board is a KiXtart developer. We are a self-help community of KiXtart end users just like you.

The developer pops in occasionally to check out reported bugs and feature requests so by all means add a "me too" with some anecdotal evidence or change proposals if you think that the thread warrants reviving.

I suggest you leave your hair alone though, you'll be grateful for whatever you have left in later life.

Top
#187730 - 2008-05-19 04:09 PM Re: Possible copy bug with 4.60? [Re: Richard H.]
Björn Offline
Korg Regular
*****

Registered: 2005-12-07
Posts: 953
Loc: Stockholm, Sweden.
And, until bugs/features has been resolved, checking for more than just the exit code from something isn't enough - check for existence of whatever you did or undid.

1 - do it
2 - check it
3 - log it
4 - fix it ;\)


Edited by Björn (2008-05-19 04:10 PM)
_________________________
as long as it works - why fix it?
If it doesn't work - kix-it!

Top
#188025 - 2008-06-03 05:20 PM Re: Possible copy bug with 4.60? [Re: Björn]
Ruud van Velsen Offline
Developer
*****

Registered: 1999-05-06
Posts: 359
Loc: Amsterdam, The Netherlands
Arr... sorry about this. Believe it or not, but COPY/MOVE are actually some of the hardest things to get right.

It looks as if I indeed broke something while fixing the 'single file' thing in 4.60.

I'll investigate and let you guys know what's up.

Ruud

Top
#188062 - 2008-06-05 08:55 AM Re: Possible copy bug with 4.60? [Re: Ruud van Velsen]
Ruud van Velsen Offline
Developer
*****

Registered: 1999-05-06
Posts: 359
Loc: Amsterdam, The Netherlands
Short update: as mentioned earlier in this thread, it's always best to specify a trailing backslash when copying to a directory.

However... KiXtart does try very hard to understand the multitude of COPY/MOVE exceptions, and this particular case should have worked.

It does now, anyway, in the update I'm working on.

More on this soon.

Thanks for the report!

Ruud

Top
#191683 - 2009-01-07 09:39 AM Re: Possible copy bug with 4.60? [Re: Ruud van Velsen]
CrimInalA Offline
Fresh Scripter

Registered: 2007-07-05
Posts: 18
Loc: ko
Any idea as when this issue will be resolved ?

What is the option for now ? use a trailing backspace if you want to copy to a directory ?
_________________________
no signature

Top
#191700 - 2009-01-07 06:28 PM Re: Possible copy bug with 4.60? [Re: CrimInalA]
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
4.61 beta 1 purports to have addressed this.
 Quote:
This update contains the following fixes & enhancements:

· Fixed issue with handling of EXIT codes
· Fixed issue with COPYing files to a directory (without specifying a backslash)
· Fixed issue with writing large DWORD values to the registry
· Updated @PRODUCTTYPE to correctly report Server 2008
· Added REPLACE function
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
Page 1 of 1 1


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

Who's Online
0 registered and 152 anonymous users online.
Newest Members
Jodey, Hiker, GTRoberts, KatieQuinn, Brennnnn
17684 Registered Users

Generated in 0.042 seconds in which 0.012 seconds were spent on a total of 13 queries. Zlib compression enabled.