revDeleteFolder and Lessons Learned..

classic Classic list List threaded Threaded
18 messages Options
Reply | Threaded
Open this post in threaded view
|

revDeleteFolder and Lessons Learned..

Chipp Walters
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
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: revDeleteFolder and Lessons Learned..

Jerry Jensen
> Date: Thu, 07 Jul 2005 21:42:51 -0500
> From: Chipp Walters <[hidden email]>

snippety...

> 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!

ARRRGH!!

I have learned.

Thanks,
Jerry Jensen

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: revDeleteFolder and Lessons Learned..

Jim Ault
In reply to this post by Chipp Walters
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" <[hidden email]> 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
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution


_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: revDeleteFolder and Lessons Learned..

Chipp Walters
Jim,

Your patch is a great idea. You should make a stack which automates it :-)

Yeah, I think it's too dangerous a command as it stands...

best,

Chipp

Jim Ault wrote:
> 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.
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: revDeleteFolder and Lessons Learned..

Jim Ault
Well, I thought I did the fix... The stack is actually locked and I am not
sure if it can be unlocked, changed and safely locked again with saving
changes.

Maybe I spoke too soon.

Jim Ault
Las Vegas


On 7/7/05 10:34 PM, "Chipp Walters" <[hidden email]> wrote:

> Jim,
>
> Your patch is a great idea. You should make a stack which automates it :-)
>
> Yeah, I think it's too dangerous a command as it stands...
>
> best,
>
> Chipp
>
> Jim Ault wrote:
>> 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.
> _______________________________________________
> use-revolution mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution


_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: revDeleteFolder and Lessons Learned..

xbury.cs
In reply to this post by Jim Ault
Chipp,

I did send a previous warning about these revhandlers 2 months ago...

http://mail.runrev.com/pipermail/use-revolution/2005-May/057551.html

cheers
Xavier


-----------------------------------------
Visit us at http://www.clearstream.com
                                                         
IMPORTANT MESSAGE

Internet communications are not secure and therefore Clearstream
International does not accept legal responsibility for the contents of
this message.

The information contained in this e-mail is confidential and may be
legally privileged. It is intended solely for the addressee. If you are
not the intended recipient, any disclosure, copying, distribution or
any action taken or omitted to be taken in reliance on it, is
prohibited and may be unlawful. Any views expressed in this e-mail are
those of the individual sender, except where the sender specifically
states them to be the views of Clearstream International or of any of
its affiliates or subsidiaries.

END OF DISCLAIMER
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: revDeleteFolder and Lessons Learned..

Dave Cragg
In reply to this post by Chipp Walters

On 8 Jul 2005, at 03:42, Chipp Walters wrote:

>
> 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!

My sympathies, Chipp. I bet that hurt.

But I'm not entirely clear of the lesson to be learned. Is the  
problem really with revDeleteFolder, or with the nature of script  
locals?

If we don't use revDeleteFolder, but we want to delete a folder, then  
we have to roll our own routines. This can be plenty dangerous too.

I have my own routine for this using the standard "directories" and  
"files" transcript routines. (There was no revDeleteFolder when I was  
a lad.) But I also managed to wipe half my hard drive before I got  
the routine working. This is a recursive routine, working through all  
of the sub-directories. My error was forgetting that the transcript  
"directories"  function always returns ".." among the list of  
folders. The routine worked perfectly, too perfectly. :(

So do we warn people not to use revDeleteFolder, and leave them to  
their own potentially dangerous devices. Or simply warn people to be  
*extremely* careful when deleting folders and check they are in fact  
deleting the intended folder.


Cheers
Dave
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: revDeleteFolder and Lessons Learned..

Chipp Walters
Hi Dave,

Well, since I passed revDeleteFolder a single "/" and it tried to delete
(w/out being able to be interrupted) the *entire* hard disk, I would say
it's less dangerous to 'roll your own'. I would expect revDeleteFolder
to take as an argument a valid path, including drive letter. For
instance I would expect:

revDeleteFolder "C:/"

to delete the C drive. I don't know why just "/" does it and I'm afraid
to test it with a null, especially since it can't be interrupted.
Anything you roll on your own can be interrupted with a control-period.

The non-interruptibility of the command is a huge issue, IMO, and one
I'm not willing to take any more chances on. I haven't looked at the
code, but as Xavier mentioned, it seems like it should be an engine
level issue, not a shell call. You are certainly welcome to use it to
your hearts content-- I won't be. Once burned, twice shy.

best,

Chipp

Dave Cragg wrote:

> But I'm not entirely clear of the lesson to be learned. Is the  problem
> really with revDeleteFolder, or with the nature of script  locals?
>
> If we don't use revDeleteFolder, but we want to delete a folder, then  
> we have to roll our own routines. This can be plenty dangerous too.

> So do we warn people not to use revDeleteFolder, and leave them to  
> their own potentially dangerous devices. Or simply warn people to be  
> *extremely* careful when deleting folders and check they are in fact  
> deleting the intended folder.
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: revDeleteFolder and Lessons Learned..

Alex Tweedly
Chipp Walters wrote:

> Hi Dave,
>
> Well, since I passed revDeleteFolder a single "/" and it tried to
> delete (w/out being able to be interrupted) the *entire* hard disk, I
> would say it's less dangerous to 'roll your own'. I would expect
> revDeleteFolder to take as an argument a valid path, including drive
> letter. For instance I would expect:
>
> revDeleteFolder "C:/"
>
> to delete the C drive. I don't know why just "/" does it and I'm
> afraid to test it with a null, especially since it can't be
> interrupted. Anything you roll on your own can be interrupted with a
> control-period.
>
"/" works  because "/" is a valid directory specifier for Rev. You can do
    set the defaultFolder to "/"
and it does; you don't need a drive specifier.
Come to think of it, you can do it in a Windows shell (or whatever a DOS
box is called these days) - "cd \"  works.

> The non-interruptibility of the command is a huge issue, IMO, and one
> I'm not willing to take any more chances on. I haven't looked at the
> code, but as Xavier mentioned, it seems like it should be an engine
> level issue, not a shell call. You are certainly welcome to use it to
> your hearts content-- I won't be. Once burned, twice shy.

Being interruptible would help - but it can be hard to interrupt
scripts; sometimes takes me repeated hits on ctrl-. for up to 10
seconds, and you can delete a lot of useful files in 10 seconds.

> Dave Cragg wrote:
>
>> So do we warn people not to use revDeleteFolder, and leave them to  
>> their own potentially dangerous devices. Or simply warn people to be  
>> *extremely* careful when deleting folders and check they are in fact  
>> deleting the intended folder.
>
I think it would be good to have an optional parameter pConfirm which
would require a user confirmation for each directory (or maybe even each
file ?). That would make it much more "comfortable" to develop and test
an application without fear of inadvertently passing a bad starting
directory, and the parameter could be reverted to (the default of) "off"
before shipping.

And as a side effect, it would need to be done in the engine rather than
as a shell command :-)

--
Alex Tweedly       http://www.tweedly.net



--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.323 / Virus Database: 267.8.10/43 - Release Date: 06/07/2005

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: revDeleteFolder and Lessons Learned..

Wouter-12
In reply to this post by Chipp Walters
Hi all,

Why patch revDeleteFolder with revDeleteFolderXXX?

Why not patch this backscript in a different way?
Like adding a param (and adapting the handler) :

  on revDeleteFolder pSrcFolder pWithoutWarning

which only will run in stealth mode if the pWithoutWarning is  
explecitely set to true.
(of course you must refrain from turning it on the first time you use  
it during development)
Older apps will still be able to use it, but only in warning mode.

Greetings,
Wouter



On 08 Jul 2005, at 12:03, Chipp Walters wrote:

> Hi Dave,
>
> Well, since I passed revDeleteFolder a single "/" and it tried to  
> delete (w/out being able to be interrupted) the *entire* hard disk,  
> I would say it's less dangerous to 'roll your own'. I would expect  
> revDeleteFolder to take as an argument a valid path, including  
> drive letter. For instance I would expect:
>
> revDeleteFolder "C:/"
>
> to delete the C drive. I don't know why just "/" does it and I'm  
> afraid to test it with a null, especially since it can't be  
> interrupted. Anything you roll on your own can be interrupted with  
> a control-period.
>
> The non-interruptibility of the command is a huge issue, IMO, and  
> one I'm not willing to take any more chances on. I haven't looked  
> at the code, but as Xavier mentioned, it seems like it should be an  
> engine level issue, not a shell call. You are certainly welcome to  
> use it to your hearts content-- I won't be. Once burned, twice shy.
>
> best,
>
> Chipp
>
> Dave Cragg wrote:
>
>
>> But I'm not entirely clear of the lesson to be learned. Is the  
>> problem really with revDeleteFolder, or with the nature of script  
>> locals?
>> If we don't use revDeleteFolder, but we want to delete a folder,  
>> then  we have to roll our own routines. This can be plenty  
>> dangerous too.
>>
>
>
>> So do we warn people not to use revDeleteFolder, and leave them  
>> to  their own potentially dangerous devices. Or simply warn people  
>> to be  *extremely* careful when deleting folders and check they  
>> are in fact  deleting the intended folder.
>>

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: revDeleteFolder and Lessons Learned..

Dave Cragg
In reply to this post by Alex Tweedly

On 8 Jul 2005, at 12:22, Alex Tweedly wrote:

> Chipp Walters wrote:
>
>
>> Hi Dave,
>>
>> Well, since I passed revDeleteFolder a single "/" and it tried to  
>> delete (w/out being able to be interrupted) the *entire* hard  
>> disk, I would say it's less dangerous to 'roll your own'. I would  
>> expect revDeleteFolder to take as an argument a valid path,  
>> including drive letter. For instance I would expect:
>>
>> revDeleteFolder "C:/"
>>
>> to delete the C drive. I don't know why just "/" does it and I'm  
>> afraid to test it with a null, especially since it can't be  
>> interrupted. Anything you roll on your own can be interrupted with  
>> a control-period.
>>
>>
> "/" works  because "/" is a valid directory specifier for Rev. You  
> can do
>    set the defaultFolder to "/"
> and it does; you don't need a drive specifier.
> Come to think of it, you can do it in a Windows shell (or whatever  
> a DOS box is called these days) - "cd \"  works.

Interesting, as
   there is a folder "/"
returns false on XP and true on OS X. Which could prove an insidious  
danger.


> I think it would be good to have an optional parameter pConfirm  
> which would require a user confirmation for each directory (or  
> maybe even each file ?). That would make it much more "comfortable"  
> to develop and test an application without fear of inadvertently  
> passing a bad starting directory, and the parameter could be  
> reverted to (the default of) "off" before shipping.

Sounds good.

Cheers
Dave
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: revDeleteFolder and Lessons Learned..

xbury.cs
Guys,

Why not ask a professional? :) I delete production files in a huge huge
file system among 20 each day.
I CANNOT make a mistake when i delete these things... We're talking
banking production...

This is what i use for the past 4 years without ONE error...

It works in NT4, NT2000 and XP. Note that the path furnished needs to be
"\" and not "/" delimited.

cheers
Xavier

function DeleteDir apath
  if " " is in apath or "&" is in apath and quote is not in apath
  then put quote & apath & quote into apath
  set the itemdelimiter to "\"
  get last item of shrname
  if char -1 of it is quote then delete last char of it
  if "$" is in char -1 of it then
    delete char -1 of it
    if length(it) = 1 or it = "IPC" then return "Danger: trying to delete
a system share!" && shrname
  end if
  get shell("rd" && apath && "/s /q")
  return it
end DeleteDir


On 08/07/2005 13:58:29 use-revolution-bounces wrote:

>On 8 Jul 2005, at 12:22, Alex Tweedly wrote:
>
>> Chipp Walters wrote:
>>
>>
>>> Hi Dave,
>>>
>>> Well, since I passed revDeleteFolder a single "/" and it tried to
>>> delete (w/out being able to be interrupted) the *entire* hard
>>> disk, I would say it's less dangerous to 'roll your own'. I would
>>> expect revDeleteFolder to take as an argument a valid path,
>>> including drive letter. For instance I would expect:
>>>
>>> revDeleteFolder "C:/"
>>>
>>> to delete the C drive. I don't know why just "/" does it and I'm
>>> afraid to test it with a null, especially since it can't be
>>> interrupted. Anything you roll on your own can be interrupted with
>>> a control-period.
>>>
>>>
>> "/" works  because "/" is a valid directory specifier for Rev. You
>> can do
>>    set the defaultFolder to "/"
>> and it does; you don't need a drive specifier.
>> Come to think of it, you can do it in a Windows shell (or whatever
>> a DOS box is called these days) - "cd \"  works.
>
>Interesting, as
>there is a folder "/"
>returns false on XP and true on OS X. Which could prove an insidious
>danger.
>
>
>> I think it would be good to have an optional parameter pConfirm
>> which would require a user confirmation for each directory (or
>> maybe even each file ?). That would make it much more "comfortable"
>> to develop and test an application without fear of inadvertently
>> passing a bad starting directory, and the parameter could be
>> reverted to (the default of) "off" before shipping.
>
>Sounds good.
>
>Cheers
>Dave
>_______________________________________________
>use-revolution mailing list
>[hidden email]
>Please visit this url to subscribe, unsubscribe and manage your
subscription
>preferences:
>http://lists.runrev.com/mailman/listinfo/use-revolution


-----------------------------------------
Visit us at http://www.clearstream.com
                                                         
IMPORTANT MESSAGE

Internet communications are not secure and therefore Clearstream
International does not accept legal responsibility for the contents of
this message.

The information contained in this e-mail is confidential and may be
legally privileged. It is intended solely for the addressee. If you are
not the intended recipient, any disclosure, copying, distribution or
any action taken or omitted to be taken in reliance on it, is
prohibited and may be unlawful. Any views expressed in this e-mail are
those of the individual sender, except where the sender specifically
states them to be the views of Clearstream International or of any of
its affiliates or subsidiaries.

END OF DISCLAIMER
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: revDeleteFolder and Lessons Learned..

Ludovic THEBAULT
Why not use something like this (here, for MacOS X) :

put specialFolderPath("Desktop") into trashFolder
set the itemDel to "/"
put ".Trash/" into last item of trashFolder
rename folder tfolderpath to trashFolder&"/"&tfolderpath



_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: revDeleteFolder and Lessons Learned..

Klaus major-k
In reply to this post by xbury.cs
Bonjour Xavier,

> Guys,
>
> Why not ask a professional? :)

A VERY good idea!

Do you happen to know one? :-D


Best

Klaus Major
[hidden email]
http://www.major-k.de

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: revDeleteFolder and Lessons Learned..

xbury.cs
You're too funny Klaus,

That's the script i use professionally... On EMC TB storage.
When it comes to delete 10 millions files... There's no way
I'd use Rev-Anything... I tested it for a minor monthly deletejob
and it didn't even work for the test. So...

So, if you ask a professional that does this kind of stuff for the
past 6 years?

First test this on a test drive (or mountpoint).
Never on your data or OS drive...

Then implement... Chipp seems to know what i mean now ;)

cheers
Xavier

On 08/07/2005 14:38:22 use-revolution-bounces wrote:

>Bonjour Xavier,
>
>> Guys,
>>
>> Why not ask a professional? :)
>
>A VERY good idea!
>
>Do you happen to know one? :-D
>
>
>Best
>
>Klaus Major
>[hidden email]
>http://www.major-k.de
>
>_______________________________________________
>use-revolution mailing list
>[hidden email]
>Please visit this url to subscribe, unsubscribe and manage your
subscription
>preferences:
>http://lists.runrev.com/mailman/listinfo/use-revolution


-----------------------------------------
Visit us at http://www.clearstream.com
                                                         
IMPORTANT MESSAGE

Internet communications are not secure and therefore Clearstream
International does not accept legal responsibility for the contents of
this message.

The information contained in this e-mail is confidential and may be
legally privileged. It is intended solely for the addressee. If you are
not the intended recipient, any disclosure, copying, distribution or
any action taken or omitted to be taken in reliance on it, is
prohibited and may be unlawful. Any views expressed in this e-mail are
those of the individual sender, except where the sender specifically
states them to be the views of Clearstream International or of any of
its affiliates or subsidiaries.

END OF DISCLAIMER
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: revDeleteFolder and Lessons Learned..

David Burgun
In reply to this post by Chipp Walters
Owwwww, that's just horrible!

I tend to develop code that can do lasting dammage on either a
seperate hard disk or another machine, it's really bad news
developing code on your "everyday" work machine.

Either that or have all my files backed up in a Source Control
Database in  server.

I reckon that a change is in order for this. How about a Global
property - "confirmDeletes" (true/false) ? This would be defaulted to
true. Or maybe a "recurseFolders" (true/false) which would control if
folders inside folders should be deleted.

All the Best
Dave

>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
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: revDeleteFolder and Lessons Learned..

Eric Chatonet
In reply to this post by Chipp Walters
Hi Chipp and others who suggested many ideas,

First, Chipp, I really feel for you in your sorrow.
One day or another, we have all known that one second thing able to  
cause havoc... and all the hours later to put the things right.

Second, I think that a command which deletes a folder *has to* delete  
a folder.
It's us who have to pay attention to a possible devastation.
As for me, I want Rev powerful.

May be, some additional statement could warn when the directory is a  
root directory but I assume that runRev guys would answer "that's  
your problem..." and they would be right.
My two cents.

Le 8 juil. 05 à 04:42, Chipp Walters a écrit :

> 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.


Best Regards from Paris,

Eric Chatonet.
----------------------------------------------------------------
So Smart Software

For institutions, companies and associations
Built-to-order applications: management, multimedia, internet, etc.
Windows, Mac OS and Linux... With the French touch

Free plugins and tutorials on my website
----------------------------------------------------------------
Web site        http://www.sosmartsoftware.com/
Email        [hidden email]/
Phone        33 (0)1 43 31 77 62
Mobile        33 (0)6 20 74 50 86
----------------------------------------------------------------

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: revDeleteFolder and Lessons Learned..

Mark Talluto

On Jul 8, 2005, at 6:25 AM, Eric Chatonet wrote:

> First, Chipp, I really feel for you in your sorrow.
> One day or another, we have all known that one second thing able to  
> cause havoc... and all the hours later to put the things right.


Virtual PC for both Macs and Windows is really useful for things like  
this.  It has an undo drive feature that protects you from mistakes  
like this.


Mark Talluto
--
CANELA Software
http://www.canelasoftware.com

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution