开发者

what the best and simplest way to find out whether a volume need defrag?

I am writing a application that monitor the system's health, user should know when they need to defrag the volumes.

What I am thinking is calling the "defrag.exe /A" then analyze the output result to see whether it contains "You do not need to defragment this vol开发者_开发技巧ume."

But it's slow and very bad, I fount that the "Analyze" is really quick on the MyDefrag.exe.

Anyone could tell me what's the best and simplest way?


In very general terms, you are going to have to:

  1. be able to learn what file system is used on the volume in questions
  2. read over the filesystem structures and accumulate statistics on how many files are broken up and how long the typical contiguous runs are
  3. compare the results of set 2 with some heuristics for when seek times start to get considerable in the total file reading time (choosing the heuristics requires some judgment). Note that the heuristic probably depends on the filesystem in use.

What step(s) are you having trouble with?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜