Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DIR *dp;
- struct dirent *dirp;
- while ((dirp = readdir(dp)) != NULL) {
- if ( isFile(dirp)) {
- cout << "IS A FILE!" << endl;
- i++;
- }
- #include <boost/filesystem/path.hpp>
- #include <boost/filesystem/operations.hpp>
- #include <iostream>
- int main() {
- using namespace boost::filesystem;
- path p("/bin/bash");
- if(is_regular_file(p)) {
- std::cout << "exists and is regular file" << std::endl;
- }
- }
- while ((dirp = readdir(dp)) != NULL) {
- if (!S_ISDIR(dirp->d_type)) {
- ...
- i++;
- }
- }
Add Comment
Please, Sign In to add comment