如何避免硬盘碎片? [英] How to avoid hard disc fragmentation?
问题描述
有没有办法避免光盘碎片?
小文件的碎片化通常不是问题。
如果文件被读取一次并不重要 - 如果一个大文件在很多部分,并且磁盘必须做大量的搜索才能完成,那么这只是真正的时间问题。
显而易见的解决方案不是写大量的小日志文件,要么将它们合并成一个大文件 - 要么使用数据库,这就是它们的用途。 p>
I'm writing an application that will make millions of calculations and will store the results in a lot of files in the disc. Potentially I can have thousand of files, of different sizes, and store until they get analyzed. After this, I'm going to keep only a couple of them, delete the others and start the process all over again. For the sake of my application this works great, but now I'm starting to worry that I'll fragment my disc like crazy (my disc uses NTFS). Defragmenting the disc drive periodically is not under my control, since I'm not the administrator of the machine.
Is there any way of avoiding the disc fragmentation?
Fragmentation of small files generally isn't an issue. If the files are read once it doesn't really matter - it's only real a time problem if a large file is in many parts and the disk must do a lot of seeks to get all of it.
The obvious solution is not to write lots of small log files, either combine them into one large file - or use a database, that's what they are there for.
这篇关于如何避免硬盘碎片?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!