Avoiding a stupid mistake

Bob Sneidar bobsneidar at iotecdigital.com
Mon May 23 11:05:23 EDT 2016


I wouldn't call it a limitation, RM. Otherwise we would have to call fire a limiting development in the evolution of cooking. LC allows a developer to do anything with the file system that the OS would allow. It just may not be immediately obvious what that is until it's too late. 

It's for issues like this that I have gotten into the habit of putting everything into variables first (file paths in this case) and then steppign through the code at least once examining all the variables as I go to make sure they contain what I expect them to. I've caught some doozies this way. 

Bob S


> On May 22, 2016, at 09:00 , RM <richmondmathewson at gmail.com> wrote:
> 
> Ha, Ha, Ha: I'm sure that everybody is dumb enough to do that at least once.
> 
> I know that I, being extra skilled, have done it (deleting things accidentally)  . . . at least . . . oh, dear, I seem to have run out of fingers and toes.
> 
> Deleting anything may lead to regrets later: hence  I have about 6 1 terabyte hard drives in external containers containing
> stuff going back to 1993.
> 
> This also points out the limitations of 'transparent' cross-platform development.
> 
> Richmond.
> 
> On 22.05.2016 18:31, Graham Samuel wrote:
>> Just for general interest -
>> 
>> I wanted to delete the Preferences folder for an app I’m working on, so I scripted a button as follows:
>> 
>>    get specialFolderPath("preferences")
>>    revdeletefolder it
>> 
>> What I’d forgotten was that on the Mac version, my preferences were not in a folder dedicated to my app, but just stored in a folder called ‘Preferences’ with all the preferences of all other apps for my whole library! So the result of pressing this button was to delete all the preferences from the machine! Luckily Time Machine came to my aid… but the point is, nothing stopped my script from executing.
>> 
>> Of course nobody else would be dumb enough to do this, but just in case…
>> 
>> Graham



More information about the Use-livecode mailing list