Page 1 of 1

revDeleteFolder not working on Windows Server 6.5.1-6.6.2

Posted: Wed Jul 23, 2014 11:40 pm
by edgore
I am trying to delete a folder using revDeleteFolder on a windows machine running server 6.5.1 and getting an error I have never seen before.

Here is a sample script:

Code: Select all

<?lc
   create folder "temp/"
   put "temp/" into targetFolder
   revDeleteFolder targetfolder
   put "finished"
?>
I get the following error in the browser:

Code: Select all

file "C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\arm19\test.lc"
  row 4, col 1: Handler: can't find handler (revDeleteFolder)
The folder "temp" gets created, so I don't think it's a permissions problem. and the same script works just fine on desktop. I checked the dictionary and it says that revDeleteFolder is supported on server.

Re: revDeleteFolder not working on Windows Server 6.5.1

Posted: Thu Jul 24, 2014 1:10 am
by FourthWorld
Try checking "the result" after the revDeleteFolder command, perhaps also including a call to sysError() to see what the OS is reporting.

Re: revDeleteFolder not working on Windows Server 6.5.1

Posted: Thu Jul 24, 2014 2:54 pm
by edgore
I tried that, but get the same error, with no output from the other two commands following the revDeleteFolder line.

Near as I can tell execution is halting when it gets to revDeleteFolder.

I suppose I should probably upgrade the server machine to the latest version of Server and see if that helps.

Re: revDeleteFolder not working on Windows Server 6.5.1

Posted: Thu Jul 24, 2014 3:04 pm
by FourthWorld
I'd wager it's either a permissions issue or the directory is not empty. Either way, more challenging is that the diagnostic info isn't returning anything - can you share that part of your code so we can see how that's being called?

Also, have you tried replacing revDeleteFolder with "delete folder <folderPath>"?

Re: revDeleteFolder not working on Windows Server 6.5.1

Posted: Thu Jul 24, 2014 3:17 pm
by edgore
I this particular case I know that the folder is empty, so I don't think it's that. And it turns out it *does* work with "delete folder <folderPath>", so it can't be permissions.

here is the code with diagnostics:

Code: Select all

<?lc
   create folder "temp/"
   put "temp/" into targetFolder
   revDeleteFolder targetfolder
   put the syserror && the result
   put "finished"
?>
this *does* work:

Code: Select all

<?lc
   create folder "temp/"
   put "temp/" into targetFolder
   delete folder targetfolder
   put "finished"
?>
I would rather use revDeleteFolder than "delete folder" just because revDeletefolder is supposed to delete a folder and all of it's contents and in my case I am deleting a possibly already existing auto-created set of directories and files and replacing them with a new set of auto-created directories and files. Using revDeleteFolder would be much more efficient and readable than traversing a bunch of folders, listing the files and deleting them.

So, I think I have found a bug - but I will check to see if it's still in server 6.6.2 before reporting.

Re: revDeleteFolder not working on Windows Server 6.5.1

Posted: Thu Jul 24, 2014 3:30 pm
by edgore
Looks like it behaves the same in 6.6.1, which is the newest version I can get from the store. Anyone know if there is a 6.6.2 version of commercial available - I can't get it from the store , but the store has often been terrible about keeping up with the latest releases on server.

Edited to add: I managed to locate the 6.6.2 community server - same result. Also, can we please get a redesign of the website? It's difficult to find stuff these days between the store links not being up to date for Server, and the link that takes you to the download for any version of community server being listed under the section of the page that is otherwise talking about downloading the commercial version.

Edited again to add: Bug 12959 filed. And because I know that saying things in the forum is not the right way to do it, a support ticket submitted about the store download links and thoughts on the organization of the general downloads page)

Re: revDeleteFolder not working on Windows Server 6.5.1-6.6.

Posted: Thu Jul 24, 2014 10:13 pm
by edgore
check the next post from me in this thread for RunRev's answer on the bug report and a solution - I am deleting this since it had an overly complicated solution to the problem that I came up with.

Re: revDeleteFolder not working on Windows Server 6.5.1-6.6.

Posted: Fri Jul 25, 2014 1:43 am
by Simon
Hi edgore,
Sorry I'm late on this but...
Make sure the folder you are deleting is not the defaultFolder. It doesn't like that.
Now I'm not saying that when you create a folder it becomes the default, but you could check it out.

Simon

Re: revDeleteFolder not working on Windows Server 6.5.1-6.6.

Posted: Fri Jul 25, 2014 3:22 pm
by edgore
I got a response on the bug report - apparently revDeleteFolder is part of the IDE and is not actually supported on server. I have mentioned that they should update the documentation to reflect that.

The solution they provided was copying the script for revDeleteFolder out of toolset\revlibrary.rev (it's in the script for the button revCommon) and putting it into my server script.