Image

Imageprotozoa wrote in Imagecpp

I've got a two-part question. First the hard part. I've recently started programming on Linux and I'm porting some Windows code I've been using. Can someone show me how to scan a directory for a specific type of file? The function prototype I'm using on Windows is

void DirTreeSearch(const std::string &sPath, const std::string &sMask, std::vector< std::pair<std::string, std::string> > &vPaths, bool bRecurse = true);

sPath is the starting folder to search, sMask is the file extension to look for (e.g. .dll on Windows), the vector of pairs should contain all the files found; the fully qualified path to the file found as first and the specific file name as second. The last parameter to the function tells the function to search in the subdirectories of the start folder.

The second part of my question: Can someone recommend a good book for programming Linux that would discuss general purpose programming stuff like this? I'm looking for a book that assumes the reader is proficient with C++ but not with API's and such on Linux.