问题描述
我使用的是Delphi7,我需要一个解决方案来解决大问题。有人可以通过使用findnext和findfirst为我提供比文件和文件夹更快的搜索方式。因为我也处理每个文件/文件夹(创建日期/作者/大小/等)的数据,它需要很多时间...我已经搜索了很多在WinApi,但可能我没有看到最好的功能命令完成这个。我在Delphi中发现的所有示例都使用findfirst和findnext ...
I'm using Delphi7 and i need a solution to a big problem.Can someone provide me a faster way for searching through files and folders than using findnext and findfirst? because i also process the data for each file/folder (creation date/author/size/etc) and it takes a lot of time...I've searched a lot under WinApi but probably I haven't see the best function in order to accomplish this. All the examples which I've found made in Delphi are using findfirst and findnext...
此外,我不想购买组件或使用一些免费的组件。
Also, I don't want to buy components or use some free ones...
提前感谢
推荐答案
你会买,也会使用findfirst / findnext。当然是递归的。我不认为有一种方法来查看每个目录和文件,而不会实际查看每个目录和文件。
I think any component that you'd buy, would also use findfirst/findnext. Recursively, of course. I don't think there's a way to look at every directory and file, without actually looking at every directory and file.
作为基准,看看你的代码是否合理快速比较WinDirStat的性能(就收集数据而言,以及准备建立其空间使用情况图。)
如果你想看看他们在做什么,可以使用源代码。这是C,但我期望它使用相同的API调用。
As a benchmark to see if your code is reasonably fast, compare performance against WinDirStat http://windirstat.info/ (Just to the point where it's gathered data, and is ready to build its graph of the space usage.)
Source code is available, if you want to see what they're doing. It's C, but I expect it's using the same API calls.
这篇关于Delphi搜索文件和目录最快的算法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!