如何限制文件碎片,同时与.NET的工作? [英] How can I limit file fragmentation while working with .NET?
本文介绍了如何限制文件碎片,同时与.NET的工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我的应用程序,我收集的小数据位到一个更大的文件,随着时间的推移。其结果是,在目标文件碎片化程度过高。有什么可以做,以限制输出文件的碎片与.NET?
In my application I am gathering small data bits into a bigger file over time. As a result, the target file becomes excessively fragmented. What can be done to limit fragmentation of the output file with .NET?
推荐答案
您可以故意增加文件大小以较大的块和内部监控在您当前使用的到底是什么。你给这样的系统有更好的机会为您的文件分配连续空间。
You could deliberately increment the file size in larger chunks and internally monitor where the end of your current usage is. That way you give the system a better chance of allocating contiguous space for your file.
这篇关于如何限制文件碎片,同时与.NET的工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文