Page 1 of 1 1
Topic Options
#155553 - 2006-01-18 04:25 AM RD Behaviour
oneill Offline
Fresh Scripter

Registered: 2005-03-24
Posts: 27
Loc: Australia
Hi There,

I have been using the beta version of Kix, 4.52 beta 2, because I wanted to use the updated RD command.

One thing I have noticed is that if I try to remove a directory it does not delete the folder I specify. It deletes all of the sub-dirs but not the root.

e.g.
RD "R:\Folder" /S
This will delete all sub-dirs but not the "folder" dir. Is this by design? I thought the whole point of RD was to delete the directory that you specify.

If you have a look at the commnets on the microsoft RD command.
"Removes all directories and files in the specified directory in addition to the directory itself. Used to remove a directory tree."

What I am after is the "in addition to the directory itself" part.

Thanks.

Top
#155554 - 2006-01-18 04:33 AM Re: RD Behaviour
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11625
Loc: CA
I reported similar but a little different behavior already. I think it is in the parse routine, either Ruud is trying to save us from ourselves - I hope not or the path information supplied is just not being correctly read / parsed. Hopefully this will be fixed in Beta 3
 

Top
#155555 - 2006-01-18 04:36 AM Re: RD Behaviour
oneill Offline
Fresh Scripter

Registered: 2005-03-24
Posts: 27
Loc: Australia
Thanks for the fast response, nice

ok, I guess I'll go back to shelling out to dos

Top
#155556 - 2006-01-18 04:43 AM Re: RD Behaviour
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11625
Loc: CA
Hmmm... I just tested that and it worked for me.

Couple questions.

1. Were there any files in the folder?
2. Is this a shared remote folder or a local drive?

If the Folder is empty then it will not be removed (currently reported bug)
 


RD "C:\TEMP\" /S

That had a couple files in it removed the entire folder for me just now.
 
Please add some error code output to your script and see what the returned error is.
 

Top
#155557 - 2006-01-18 05:43 AM Re: RD Behaviour
oneill Offline
Fresh Scripter

Registered: 2005-03-24
Posts: 27
Loc: Australia
I get the follow error when trying to delete an empty folder


RD "R:\New Folder" /S or RD "R:\New Folder\" /S
? @ERROR
? @SERROR

2
The system cannot find the file specified.

If I run the same command with a subfoler I get the same error.
If I run the same command with a text file in the folder it deletes the folder and returns a success

If the subfolder has a folder which has other folders and files it still returns an error.

I get the same result for both local and network drive.
I haven't tried it on a share.


Edited by oneill3 (2006-01-18 06:13 AM)

Top
#155558 - 2006-01-18 06:28 AM Re: RD Behaviour
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11625
Loc: CA
Works fine for me.

Try this from the root of C:

DIR KIX32.EXE /S

Then remove any other versions of KiXtart and make sure you're ONLY running 4.52B2 as any other version will not work.
 
Try this and post the results please.

 
Break On
Dim $SO
$SO=SetOption('Explicit','On')
$SO=SetOption('NoVarsInStrings','On')
$SO=SetOption('NoMacrosInStrings','On')

'My KiX version is: ' + @KiX ?
RD "C:\New Folder\" /S
'remove folder error: ' + @ERROR + ' ' +@SERROR ?

 

Top
#155559 - 2006-01-18 06:40 AM Re: RD Behaviour
oneill Offline
Fresh Scripter

Registered: 2005-03-24
Posts: 27
Loc: Australia
Here are the results.

My KiX version is: 4.52 Beta 2
remove folder error: 2 The system cannot find the file specified.

Also, the folder was not deleted.

If I create a text file in the root of the folder of the "New Folder" it deletes the folder. Here are the results.

My KiX version is: 4.52 Beta 2
remove folder error: 0 The operation completed successfully.


Edited by oneill3 (2006-01-18 06:41 AM)

Top
#155560 - 2006-01-18 07:31 AM Re: RD Behaviour
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11625
Loc: CA
Yes, exactly as already reported as a bug.

Thanks for the confirmation. Hopefully will be fixed in next beta.

Top
#155561 - 2006-01-18 07:33 AM Re: RD Behaviour
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
but if there are no files in the folder but only subdirs, it is again not deleted?
doc, did Ruud respond already in that other thread or via mail?


Edited by Jooel (2006-01-18 07:36 AM)
_________________________
!

download KiXnet

Top
#155562 - 2006-01-18 07:56 AM Re: RD Behaviour
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11625
Loc: CA
it removes empty folders for me further down the path as long as the folder that was set to be removed has a file in it. If the folder that is set to be removed DOES NOT have a file in it then the whole operation will fail regardless of file depth. The KEY to it working or not is if the folder set to be removed has any files in it or not.

RD "C:\TEMP\TEST\John" /s
And the folder is like this below... If Data or Folders or Finance is blank or has files doesn't matter. If the folder John has at least a single file it in the whole structure will be removed. If John has no files and the other folders do have files the whole operation will fail.

C:\TEMP\TEST\John\Data\Folders\Finance

No, Ruud did not respond yet that I'm aware of, but he doesn't always respond. Often he just fixes it and tells us about it.


Edited by NTDOC (2006-01-18 08:05 AM)

Top
#155563 - 2006-01-24 12:12 PM Re: RD Behaviour
Arend_ Moderator Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1896
Loc: Hilversum, The Netherlands
I've tested this trough and trough what I find is that the /S switch works fine as long as there are subfiles and folders in the folder you are trying to delete. Everything gets deleted. But if you specify the /S switch on an empty folder you get an error, which in turn will get deleted if you don't specify the /S switch.

(edit) after reading NTDOC's last message, I basically said what he said...


Edited by apronk (2006-01-24 12:14 PM)

Top
#155564 - 2006-04-17 11:46 AM Re: RD Behaviour
Ruud van Velsen Moderator Offline
Developer
*****

Registered: 1999-05-06
Posts: 391
Loc: Amsterdam, The Netherlands
Thanks for the report, this is fixed in RC1.

Ruud

Top
#155565 - 2006-05-10 02:27 AM Re: RD Behaviour
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11625
Loc: CA
Further testing of RD shows that it does not support a UNC path structure with spaces.

A typical UNC might be something like this:

\\Computer\c$\Documents and Setting\JohnDoe

There does not appear to be a valid method to DYNAMICALLY reduce or use UNC with spaces in the path.
 
Would like to request RD be updated to support UNC mechanism with spaces in the UNC path somehow, or some method to DYNAMICALLY properly shorten the path for use.

 

Top
#155566 - 2006-05-11 11:30 PM Re: RD Behaviour
Ruud van Velsen Moderator Offline
Developer
*****

Registered: 1999-05-06
Posts: 391
Loc: Amsterdam, The Netherlands
Have you tried enclosing the path in quotes? Eg:

RD "\\Computer\c$\Documents and Settings\JohnDoe"

Ruud

Top
#155567 - 2006-05-11 11:48 PM Re: RD Behaviour
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11625
Loc: CA
I've tried a couple variations on it, but will try and do further testing/analysis of the real issue and get back to you.

Thanks.

Top
#155568 - 2006-05-12 12:15 AM Re: RD Behaviour
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11625
Loc: CA
CMD.EXE can not do this it will start another instance of a CMD console
start "\\server\share"

NET USE X: "\\server\share"
The command completed successfully.

So it rather depends on the utility that one is using.
It would seem that it is the application and not the OS that is handling this.


I just ran a simple test like this and it worked okay
RD "\\itsupport2\c$\bogus\Test Removal" /s
'Error: ' + @ERROR + ' - ' + @SERROR ?

So it would seem that somewhere I must have not written the quotes correctly
for RD to use, or some other issue.


Will review the larger script where this gave me a problem and see if I can track down the issue, or error in my own coding.

Thanks Ruud.

Any word on when we can get ahold of the next beta?
 

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 1574 anonymous users online.
Newest Members
BeeEm, min_seow, Audio, Hoschi, Comet
17882 Registered Users

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