Computer Science Canada Recursion for deleting |
Author: | Carey [ Thu Apr 19, 2007 9:36 am ] | ||
Post subject: | Recursion for deleting | ||
Having a bit of difficulty making a procedure that deletes all the dirs and files within a dir. Heres my code so far. Sorry about the lack of commenting and the messyness.
Just call delete2 with the folder you want to delete as the parameter to test. |
Author: | ericfourfour [ Thu Apr 19, 2007 4:25 pm ] |
Post subject: | RE:Recursion for deleting |
All of that code can be replaced with Dir.Delete (path). |
Author: | Carey [ Mon Apr 23, 2007 6:57 am ] |
Post subject: | Re: Recursion for deleting |
In what version of Turing? Ive got 4.0.5. is it different in 4.1? Turing 4.0.5 Help wrote: Dir.Delete is used to delete the directory specified by the parameter directoryPathName. This is the equivalent of doing a rmdir in DOS or UNIX. On the Macintosh, it removes a folder. Dir.Delete will fail if it attempts delete a directory that has files in it. |
Author: | Carey [ Wed May 02, 2007 9:06 am ] |
Post subject: | Re: Recursion for deleting |
Sorry about the double post, but does anybody have any suggestions? Or have i finally stumped the compsci.ca members? ![]() |
Author: | Cervantes [ Sat May 05, 2007 2:01 pm ] | ||
Post subject: | Re: Recursion for deleting | ||
Oh no, we're not stumped. Never! Here you go. Feel free to ask questions.
|
Author: | BenLi [ Sat May 05, 2007 9:46 pm ] |
Post subject: | RE:Recursion for deleting |
potentially able to be put in bad use? |
Author: | Cervantes [ Sat May 05, 2007 10:51 pm ] |
Post subject: | RE:Recursion for deleting |
Potentially, yes. But it's a very good example of recursion; a good learning experience. |
Author: | Carey [ Mon May 07, 2007 9:20 am ] |
Post subject: | Re: Recursion for deleting |
Thanks guys. I see what i did wrong now. I knew that stumped comment would get me some replys!! ![]() |