summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2003-04-28 19:15:10 (GMT)
committerTim Peters <tim.peters@gmail.com>2003-04-28 19:15:10 (GMT)
commita390c6e194a7a7787aa0dfee0ac6628e542add54 (patch)
treec1f516640445e6f13d897051b46002a93d113fec
parent5501b5e3d769e56d48722e97dd98f571ff128a54 (diff)
downloadcpython-a390c6e194a7a7787aa0dfee0ac6628e542add54.zip
cpython-a390c6e194a7a7787aa0dfee0ac6628e542add54.tar.gz
cpython-a390c6e194a7a7787aa0dfee0ac6628e542add54.tar.bz2
walk() docs: Emphasize that the recursive-delete example is dangerous.
-rw-r--r--Doc/lib/libos.tex2
1 files changed, 2 insertions, 0 deletions
diff --git a/Doc/lib/libos.tex b/Doc/lib/libos.tex
index 6a1223f..c9cf137 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))