Reputation: 12452
I am not sure if this is possible but is it possible to loop through files in a directory in c++?
For example, how do I know how many files there are in a directory from c++ file and how do I individually call that file instead of manually giving the path to each file which would be extremely painful?
while(1){
pcl::io::loadPCDFile<pcl::PointXYZ> ("getFiles.pcd", *cloud1); <-- each file
}
Upvotes: 2
Views: 4288
Reputation: 283684
There are OS-specific solutions, like
opendir
and readdir
on LinuxFindFirstFile
and FindNextFile
on Windowsor you can use Boost Filesystem, which has already figured out all the OS-specific bits.
Upvotes: 3