rename folder not working?

J. Landman Gay jacque at hyperactivesw.com
Thu Dec 14 13:31:24 EST 2017


I'd saved this one:

on revSBEnsureFolder pFolder
   set the itemDel to "/"
   if there is no folder pFolder and pFolder is not empty then
     revSBEnsureFolder item 1 to -2 of pFolder
     if the result is not empty then return the result
     create folder pFolder
     return the result
   end if
end revSBEnsureFolder

On 12/14/17 11:02 AM, Alex Tweedly via use-livecode wrote:
> Write yourself (or check if the Master Library already has) a little 
> function
> 
>   ensureFolderExists pPathName
> 
> which will iterate down the elements of the path, checking htey exist, 
> or creating if need be.
> 
> (I *know* I have one somewhere - but it would be faster to re-write than 
> to find :-)
> 
> Then use that before the revCopyFolder
> 
> Alex
> 
> 
> On 14/12/2017 16:52, Bob Sneidar via use-livecode wrote:
>> Okay it looks like the revMoveFolder suffers from the same problem 
>> that renameFolder does: It only works on the endpoint. CRAP! Why so 
>> difficult? I'll come up with a workaround I suppose, or else start 
>> saving filled forms in the database itself.
>>
>> Thanks all for your help.
>>
>> Bob S
>>
>>
>>> On Dec 14, 2017, at 08:28 , Bob Sneidar via use-livecode 
>>> <use-livecode at lists.runrev.com> wrote:
>>>
>>> For Mac sure. Then I need to deal with Windows. But it's my 
>>> understanding that the rev commands for files use shell anyway, so 
>>> the work has at least partly been done. But looking at the rev 
>>> commands it appears there is a revMoveFolder! Lemme try that one.
>>>
>>> Bob S
>>>
>>>
>>>
>>>> On Dec 14, 2017, at 08:22 , Mike Bonner via use-livecode 
>>>> <use-livecode at lists.runrev.com> wrote:
>>>>
>>>> Can you use shell?  mv to move a folder or cp -R and do a recursive 
>>>> copy?
>>>>
>>>>  From reading the dictionary, it does seem that your first example 
>>>> should
>>>> work if the intention is to move the 201 folder from "Childrens Law 
>>>> Center"
>>>> to folder "bobtest" assuming bobtest already exists, and folder 201 
>>>> doesn't
>>>> pre-exist in that folder. (No clue how "clobbers" are handled with 
>>>> rename
>>>> when its used to move stuff)
>>>
>>> _______________________________________________
>>> use-livecode mailing list
>>> use-livecode at lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your 
>>> subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your 
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
> 
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your 
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com





More information about the use-livecode mailing list