程序运行没问题。
但是我有个疑问。。见图:
我是用了FindFirstFile()和FindNextFile()遍历所有文件夹,上图是我读取的路径,里面有两个文件夹,一个默认,一个新建,但是我发现读取时FindFirstFile()读取的先是新建的文件夹名称,然后才是默认的文件夹,难道不应该先读取默认文件夹吗?
求解惑啊。。
程序运行没问题。
但是我有个疑问。。见图:
我是用了FindFirstFile()和FindNextFile()遍历所有文件夹,上图是我读取的路径,里面有两个文件夹,一个默认,一个新建,但是我发现读取时FindFirstFile()读取的先是新建的文件夹名称,然后才是默认的文件夹,难道不应该先读取默认文件夹吗?
求解惑啊。。
https://msdn.microsoft.com/en-us/library/aa364418(VS.85).aspx 上面的Remark写了原因:
The FindFirstFile function opens a search handle and returns information about the first file that the file system finds with a name that matches the specified pattern. This may or may not be the first file or directory that appears in a directory-listing application (such as the dir command) when given the same file name string pattern. This is because FindFirstFile does no sorting of the search results.
FindFirstFile找到的文件和文件/文件夹显示的顺序不一定一样的,因为其对找到的结果不进行排序。