如何产生文件系统碎片?
文件碎片的风险因素包括大部分磁盘已满和重复的文件追加。文件碎片的其他风险因素还有哪些?如何使用 C++/C#/VB/VB.NET 等通用语言编写一个程序来处理文件和数据?创建新文件以增加文件碎片?
WinXP / NTFS 是目标
编辑:这样的方法是一个好方法吗?硬盘可用空间 = FreeMB_atStart
- 会创建 10MB 的文件来填充 剩余硬盘空间的 90%
- 删除每 3 个创建的文件
- ,使文件大小为 FreeMB_atStart * .92 / 3
Risk Factors for File Fragmentation include mostly full Disks and repeated file appends. What are other risk factors for file fragmentation? How would one make a program using common languages like C++/C#/VB/VB.NET to work with files & make new files with the goal of increasing file fragmentation?
WinXP / NTFS is the target
Edit: Would something like this be a good approach? Hard Drive free space = FreeMB_atStart
- Would creating files of say 10MB to fill
90% of the remaining hard drive space - Deleting every 3rd created file
- making file of size FreeMB_atStart * .92 / 3
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这应该在大多数文件系统上至少实现某种程度的碎片:
逐字节写入很重要,因为否则如果文件系统是智能的,它可以将大文件写入单个连续的位置。
This should achieve at least some level of fragmentation on most file systems:
Writing it byte-by-byte is important, because otherwise if the file system is intelligent, it can just write the large file to a single contiguous place.
另一种可能性是同时逐字节写入多个文件。这可能会产生更大的效果。
Another possibility would be to write several files simultaneously byte-by-byte. This would probably have more effect.