revDeleteFolder and Lessons Learned..

Jim Ault JimAultWins at yahoo.com
Fri Jul 8 01:29:04 EDT 2005


Hmmm, could there be a patch to help the novice, the unwary, or the
forgetful (or those who do not know how to fix Rev)?

Just changed mine to " on revDeleteFolderXXX ...end  revDeleteFolderXXX "
 in button revCommon in stack revLibraries...in case some other stack I get
from somewhere tries to use revDeleteFolder...it is not there anymore.

Of course, downloading or installing a new version would probably have
revDeleteFolder again, so this is on my to do list for new installs/updates.

Thanks for the heads up, Chipp.

Jim Ault
Las Vegas


On 7/7/05 7:42 PM, "Chipp Walters" <chipp at chipp.com> wrote:

> Here's an interesting story:
> 
> Last night I was working on a 'reset prefs' handler which was to remove
> all the files in a folder.
> 
> It looked something like:
> 
> on resetPrefs
>    put lMasterFolderPath & "/" & lProjectName into tFolderToDelete
>    revDeleteFolder tFolderToDelete
> end resetPrefs
> 
> lMasterFolderPath and lProjectNames are script locals.
> 
> I also have a handler 'checkLocals' which I should've put at the top,
> but I digress.
> 
> In anycase, after applying the script and running, of course the script
> locals are now nulls and the revDeleteFolder contained only a single
> "/", which apparently means: "Delete the entire route hard drive".
> 
> After running it and seeing the processor shoot to 100% and stay there,
> I guessed something was wrong. I tried to quit it, but it's a shell
> script and even the task manager wouldn't allow me to kill it.
> 
> By the time I was able to force shutdown my machine, most the entire
> Windows partition was wasted. Fortunately, my Linux partition was still
> good and I could access my Documents folder and grab most of the stuff
> that mattered, but of course WinXP was completely hosed.
> 
> My lesson learned is NEVER, NEVER, NEVER use revDeleteFolder. I rewrote
> the script to use 'the files' and delete each file individually.
> 
> Hope others can learn from my mistake!
> 
> best,
> 
> Chipp
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution





More information about the use-livecode mailing list