如何避免硬盘碎片? [英] How to avoid hard disc fragmentation?

查看:148
本文介绍了如何避免硬盘碎片?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个应用程序,将进行数百万计算,并将结果存储在光盘中的许多文件。可能我可以有一千个不同大小的文件,并存储,直到他们得到分析。在此之后,我将只保留其中一些,删除其他人,并重新开始整个过程​​。为了我的应用程序,这个工程很好,但现在我开始担心,我会像疯了一样碎片我的光盘(我的光盘使用NTFS)。定期对磁盘驱动器进行碎片整理不在我的控制之下,因为我不是机器的管理员。



有没有办法避免光盘碎片?

解决方案

小文件的碎片化通常不是问题。
如果文件被读取一次并不重要 - 如果一个大文件在很多部分,并且磁盘必须做大量的搜索才能完成,那么这只是真正的时间问题。

显而易见的解决方案不是写大量的小日志文件,要么将它们合并成一个大文件 - 要么使用数据库,这就是它们的用途。 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆