这是一个用c ++ 2011(VS)编写的函数;我正在使用此函数来获取每个目录中每个文件的扩展名和大小。我的问题是当有一个非英文字母名称的文件夹时,它不会打开该文件夹来搜索扩展名。如果有人能帮我解决这个问题,我将不胜感激。
void scan(path const& f)
{
directory_iterator d(f);
directory_iterator e;
for (; d != e; ++d)
{
string ext = d->path().extension();
_ULonglong size = file_size(d->path());
if (is_directory(d->status()))
scan(d->path());
}
}