Information générale
Catégorie:
Codage, syntaxe et commandes
>I recently wrote a recursive program to mimic the deltree command. (delete files, recursively delete sub-dirs, remove the now-empty directory)
>
>It is fast and code efficient. I learned the hard way though that the ".." directory can cause some grief- I wanted to remove c:\delme, where the filesystem lists ".." as the parent directory. The code ran on the parent (root of c:) and it effectively deleted everything on my hard drive! It stopped on an in-use windows file, but i learned how many more windows critical files weren't in-use (and therefore gone) when i tried to reboot later.
You can avoid all these problems if you use the Scripting.FileSystemObject, the DeleteFolder method. It's faster too.
>I don't know what table-like data would be modelled with a directed graph, but recursion is an efficient way to traverse a graph too... (at least that was the example we used for recursion)
Not any type of graphs. Only trees.
Vlad
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement