-
Notifications
You must be signed in to change notification settings - Fork 17.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
os: "os.RemoveAll" sometimes returns error "remove files: directory not empty" #23452
Comments
os.RemoveAll
sometimes returns error "remove files: directory not empty"
Can you please include a runnable code sample that demonstrates the issue. Thank you.
… On 16 Jan 2018, at 06:45, CWen ***@***.***> wrote:
I use os.RemoveAll remove dir, and program sometimes return "remove pd: directory not empty"
drwx------. 5 xxx xxx 4.0K Jan 16 03:22 pd
What version of Go are you using (go version)?
go version: go version go1.9.2 linux/amd64
What operating system and processor architecture are you using (go env)?
os : CentOS Linux release 7.3.1611 (Core)
kernel: 3.10.0-514.el7
What did you do?
What did you expect to see?
I expect os.RemoveAll to delete all the files
What did you see instead?
Sometimes the dir is not deleted and then an error is thrown.
Thanks!
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Is it possible that some other goroutine, or some other process, is creating entries in the directory as you are trying to delete it? |
@ianlancetaylor you are true, I just found this problem, Thanks. Another process is using this dir. I delete this directory for the purpose of letting the program exit. When |
Thanks for confirming. Closing |
I use
os.RemoveAll
remove dir, and program sometimes return "remove pd: directory not empty"What version of Go are you using (
go version
)?go version: go version go1.9.2 linux/amd64
What operating system and processor architecture are you using (
go env
)?os : CentOS Linux release 7.3.1611 (Core)
kernel: 3.10.0-514.el7
What did you do?
What did you expect to see?
I expect os.RemoveAll to delete all the files
What did you see instead?
Sometimes the dir is not deleted and then an error is thrown.
Thanks!
The text was updated successfully, but these errors were encountered: