From: Tim Peters Date: Mon, 28 Apr 2003 19:15:10 +0000 (+0000) Subject: walk() docs: Emphasize that the recursive-delete example is dangerous. X-Git-Tag: v2.3c1~951 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a390c6e194a7a7787aa0dfee0ac6628e542add54;p=python walk() docs: Emphasize that the recursive-delete example is dangerous. --- diff --git a/Doc/lib/libos.tex b/Doc/lib/libos.tex index 6a1223fd3b..c9cf137b8a 100644 --- a/Doc/lib/libos.tex +++ b/Doc/lib/libos.tex @@ -1126,6 +1126,8 @@ directory is empty: import os from os.path import join # Delete everything reachable from the directory named in 'top'. +# CAUTION: This is dangerous! For example, if top == '/', it +# could delete all your disk files. for root, dirs, files in os.walk(top, topdown=False): for name in files: os.remove(join(root, name))