]> Cypherpunks repositories - gostls13.git/commit
os: when looping in RemoveAll, close and re-open directory
authorIan Lance Taylor <iant@golang.org>
Wed, 27 Jun 2018 18:05:09 +0000 (11:05 -0700)
committerIan Lance Taylor <iant@golang.org>
Wed, 27 Jun 2018 22:05:25 +0000 (22:05 +0000)
commita6a69227f6b4905a9bd9fe1755a28c7a9e36df7e
tree764841badb3aecbf83033397ffb85097686e633f
parent83092a40ac606d87169fd6d0ee40f20bc93adeaf
os: when looping in RemoveAll, close and re-open directory

On some systems removing files can cause a directory to be re-shuffled,
so simply continuing to read files can cause us to miss some.
Close and re-open the directory when looping, to avoid that.

Read more files each time through the loop, to reduce the chance of
having to re-open.

Fixes #20841

Change-Id: I98a14774ca63786ad05ba5000cbdb01ad2884332
Reviewed-on: https://go-review.googlesource.com/121255
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/os/path.go