revDeleteFolder not working on Windows Server 6.5.1-6.6.2

Are you using LiveCode to create server scripts or CGIs?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
edgore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 197
Joined: Wed Jun 14, 2006 8:40 pm

revDeleteFolder not working on Windows Server 6.5.1-6.6.2

Post by edgore » Wed Jul 23, 2014 11:40 pm

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.
Last edited by edgore on Thu Jul 24, 2014 5:42 pm, edited 2 times in total.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9802
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: revDeleteFolder not working on Windows Server 6.5.1

Post by FourthWorld » Thu Jul 24, 2014 1:10 am

Try checking "the result" after the revDeleteFolder command, perhaps also including a call to sysError() to see what the OS is reporting.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

edgore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 197
Joined: Wed Jun 14, 2006 8:40 pm

Re: revDeleteFolder not working on Windows Server 6.5.1

Post by edgore » Thu Jul 24, 2014 2:54 pm

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.
Last edited by edgore on Thu Jul 24, 2014 3:04 pm, edited 1 time in total.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9802
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: revDeleteFolder not working on Windows Server 6.5.1

Post by FourthWorld » Thu Jul 24, 2014 3:04 pm

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>"?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

edgore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 197
Joined: Wed Jun 14, 2006 8:40 pm

Re: revDeleteFolder not working on Windows Server 6.5.1

Post by edgore » Thu Jul 24, 2014 3:17 pm

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.

edgore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 197
Joined: Wed Jun 14, 2006 8:40 pm

Re: revDeleteFolder not working on Windows Server 6.5.1

Post by edgore » Thu Jul 24, 2014 3:30 pm

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)

edgore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 197
Joined: Wed Jun 14, 2006 8:40 pm

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

Post by edgore » Thu Jul 24, 2014 10:13 pm

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.
Last edited by edgore on Fri Jul 25, 2014 3:40 pm, edited 1 time in total.

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am
Location: Palo Alto

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

Post by Simon » Fri Jul 25, 2014 1:43 am

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
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

edgore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 197
Joined: Wed Jun 14, 2006 8:40 pm

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

Post by edgore » Fri Jul 25, 2014 3:22 pm

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.

Post Reply

Return to “CGIs and the Server”