]> granicus.if.org Git - python/commitdiff
os.unlinkat() has been removed, update os.fwalk() doc
authorVictor Stinner <victor.stinner@gmail.com>
Sun, 5 Aug 2012 13:18:02 +0000 (15:18 +0200)
committerVictor Stinner <victor.stinner@gmail.com>
Sun, 5 Aug 2012 13:18:02 +0000 (15:18 +0200)
Doc/library/os.rst

index 40c2887a52de31c3a2c3301c7815a2aab130eca7..dae5037418b372bc8e8000c33e85cdb38b0888af 100644 (file)
@@ -2248,7 +2248,7 @@ features:
               dirs.remove('CVS')  # don't visit CVS directories
 
    In the next example, walking the tree bottom-up is essential:
-   :func:`unlinkat` doesn't allow deleting a directory before the directory is
+   :func:`rmdir` doesn't allow deleting a directory before the directory is
    empty::
 
       # Delete everything reachable from the directory named in "top",
@@ -2258,9 +2258,9 @@ features:
       import os
       for root, dirs, files, rootfd in os.fwalk(top, topdown=False):
           for name in files:
-              os.unlinkat(rootfd, name)
+              os.unlink(name, dir_fd=rootfd)
           for name in dirs:
-              os.unlinkat(rootfd, name, os.AT_REMOVEDIR)
+              os.rmdir(name, dir_fd=rootfd)
 
    Availability: Unix.