How would I go about reading all files in a directory?
In C# I would get a DirectoryInfo object, and get all files into a FileInfo[] object.
Is there similar functionality in the STD namespace in C++?
To get a list of all the files and folders in a particular directory in the filesystem, use os. listdir() in legacy versions of Python or os. scandir() in Python 3.
For a free, portable solution try the Boost Filesystem Library.
Using Windows API, you can find all the files in a directory using FindFirstFile() with FindNextFile() in a loop.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With