这类技巧可以用来建立索引,或将目录树状结构内容的索引反转。
This type of technique could be used to create indexes or reverse indexes of the contents of a directory tree.
这个范例显示如何查询所指定目录树状结构中的所有档案、开启每个档案,然后检查档案的内容。
This example shows how to query over all the files in a specified directory tree, open each file, and inspect its contents.
这个作法在逐一查看大型目录树状结构时比较快,尽管处理时间相较于第一个范例可能会根据许多因素而不同。
This approach can be faster when you are iterating over large directory trees, although the processing time compared to the first example can depend on many factors.
应用推荐