Skip to content
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

在windows中使用os.Rename #2

Open
Haif-07 opened this issue Oct 23, 2024 · 0 comments
Open

在windows中使用os.Rename #2

Haif-07 opened this issue Oct 23, 2024 · 0 comments
Labels

Comments

@Haif-07
Copy link
Owner

Haif-07 commented Oct 23, 2024

1.在mac和linux中,Rename在没有关闭文件的时候也可以正常使用。
2.在windows中,请确保文件已正常关闭。开发中通常是因为使用了defer file.close,后续代码没有正确关闭文件句柄
3.在我个人经历中错误提示为 “rename xxxxxxx access denied”。
4.相关文章https://stackoverflow.com/questions/41365318/access-is-denied-when-renaming-folder

@Haif-07 Haif-07 added the golang label Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant