O
O
Oleg Solovyov2015-03-16 16:09:31
linux
Oleg Solovyov, 2015-03-16 16:09:31

Why boost::filesystem doesn't see folder on centOS in direct path?

I am using gcc // version 4.8.2 20140120 (Red Hat 4.8.2-16) (GCC)
to compile projects under different axes, but boost is not going to see the folder even in direct path:

void Database::initializeByFolder(const char* _folder_path)
{
    std::cout << "FOLDER: " << _folder_path << std::endl;
    directory_iterator end;
    boost::filesystem::
    wpath path(_folder_path);
    try{
        boost::filesystem::is_directory(path);

        for (directory_iterator dir(path); dir != end; dir++)
        {
            const String path = dir->path().string();
            m_files_list.push_back(path);
        }
    } catch(const filesystem_error& e)
    {
        if ( e.code() == errc::permission_denied )
        {
            std::cout
                << "Search permission is denied for one of the directories "
                << "in the path prefix of "
                << path
                << std::endl;
        }
        else
            std::cout
                << "is_directory("
                << path
                << ") failed with "
                << e.code().message()
                << std::endl;
    }

    createThreadsAndRun(&Database::processing, this);
    joinAll(thread_group);
}

I get the output:
FOLDER: /home/*******/workspace/cloud_toolset/dep/routes/
") failed with No such file or directoryud_toolset/dep/routes/

If you do boost::filesystem::is_directory(path); then the returned value will be 0, if you know what it can be connected with and why folder names are stuck together in the output, please tell me!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
izyk, 2015-03-17
@izyk

Are there paths with soft links or spaces?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question