Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
クロスプラットフォームの C++ コードからディレクトリにアクセスしています。このディレクトリには 3 つのサブディレクトリがあることはわかっていますが、それらの名前はランダムに生成されます。
私が欲しいのは、これらのディレクトリ (ファイルではありません!) の名前を std::string 型として含むリストです。可能であれば、boost や qt などのライブラリの使用を避け、標準の C++ を維持したいと考えています。
私は自分自身をロールバックしました...「findFirst」および「findNext」アプローチを効果的に実装しました。Windows では and を使用_findfirstし_findnext、_finddata_t結果を利用してディレクトリかどうかを判断できます (再帰用)。*nix プラットフォームでは、ディレクトリであるかどうかを判断するために使用しopendirたりreaddir、使用したりしました。stat
_findfirst
_findnext
_finddata_t
opendir
readdir
stat