commit | a6a69227f6b4905a9bd9fe1755a28c7a9e36df7e | [log] [tgz] |
---|---|---|
author | Ian Lance Taylor <iant@golang.org> | Wed Jun 27 11:05:09 2018 -0700 |
committer | Ian Lance Taylor <iant@golang.org> | Wed Jun 27 22:05:25 2018 +0000 |
tree | 764841badb3aecbf83033397ffb85097686e633f | |
parent | 83092a40ac606d87169fd6d0ee40f20bc93adeaf [diff] |
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>
Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.
Gopher image by Renee French, licensed under Creative Commons 3.0 Attributions license.
Our canonical Git repository is located at https://go.googlesource.com/go. There is a mirror of the repository at https://github.com/golang/go.
Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.
Official binary distributions are available at https://golang.org/dl/.
After downloading a binary release, visit https://golang.org/doc/install or load doc/install.html in your web browser for installation instructions.
If a binary distribution is not available for your combination of operating system and architecture, visit https://golang.org/doc/install/source or load doc/install-source.html in your web browser for source installation instructions.
Go is the work of thousands of contributors. We appreciate your help!
To contribute, please read the contribution guidelines: https://golang.org/doc/contribute.html
Note that the Go project uses the issue tracker for bug reports and proposals only. See https://golang.org/wiki/Questions for a list of places to ask questions about the Go language.