-
Notifications
You must be signed in to change notification settings - Fork 546
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
File.renameTo及File.setReadOnly的问题 #90
Labels
bug
Something isn't working
Comments
感谢指出,MyPerf4J 的开发与使用基本在 MacOS 和 Linux 上,所以对 Windows 系统的测试不够充分; |
不过,每一次更新文件都是生成临时文件然后覆盖旧文件,设置 readonly 不会有问题才对 |
定位到原因了,是 fileWriter 还没关闭呢,就要重命名,所以一直导致 renameTo 返回 false 但是重命名和设置只读属性的逻辑挪到 我换成了 |
欢迎提交 PR : ) |
5 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug 描述
请清晰和简洁的描述你遇见的 bug,方便快速的定位和解决问题
运行环境
MyPerf4J/MyPerf4J-Core/src/main/java/cn/myperf4j/core/MethodMetricsHistogram.java
Lines 83 to 84 in 4c0a98d
renameTo 在 window 上一直都是返回 false ,所以一直只创建了 tmp 文件,没生成最终的文件
并且假如第一次生成了最终的文件的话,并且给设置成了 readonly , 那下一轮生成的时候会报错的吧
The text was updated successfully, but these errors were encountered: