Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4609014
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T00:55:36+00:00 2026-05-22T00:55:36+00:00

code: boost::filesystem::path config_folder(Config::CONFIG_FOLDER_NAME); if( !(boost::filesystem::exists(config_folder))) { std::cout << Network Config Directory not found…\n; std::cout

  • 0

code:

boost::filesystem::path config_folder(Config::CONFIG_FOLDER_NAME);

if( !(boost::filesystem::exists(config_folder)))
{
    std::cout << "Network Config Directory not found...\n";
    std::cout << "Creating folder called " << Config::CONFIG_FOLDER_NAME << "\n";
    boost::filesystem::create_directory(config_folder);
}

if( !(boost::filesystem::exists(boost::format("%s/%s") % config_folder % Config::fmap[Config::current_hash_function]));
{
    std::cout << "This hash has not been configure before...\n";
    std::cout << "Creating folder called " << Config::fmap[Config::current_hash_function] << "\n";
    boost::filesystem::create_directory(boost::format("%s/%s") % config_folder % Config::fmap[Config::current_hash_function]);
}

So, first, if the config folder doesn’t exist, create that. (this part works)
Next, check if the current_hash_function folder exists, if not.. create it. (this part doesn’t work)

The error I’m getting;

src/neural_networks/shared.cpp:41: error: no matching function for call to ‘exists(boost::basic_format<char, std::char_traits<char>, std::allocator<char> >&)’

reason why I did the boost format in the fs:exists check, is because I don’t how to create a path 2 levels deep

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T00:55:36+00:00Added an answer on May 22, 2026 at 12:55 am

    The / operator is overloaded to concatenate path objects. No need for explicit string formatting, and no need to worry about the platform-specific path-separator character, either.

    if(!(boost::filesystem::exists(config_folder / Config::fmap[Config::current_hash_function]));
    

    Either operand can be a std::string as long as the other is a path.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have code: std::string firstFile = boost::filesystem::path(first->name()).leaf(); But get error: error conversion from ‘boost::filesystem3::path’
I'm getting path to current directory with boost filesystem, then checking if the directory
I'm trying to compile the following snippet of code: #include <boost/filesystem/path.hpp> //Other includes snipped
the example code on the boost website is not working. http://www.boost.org/doc/libs/1_46_1/libs/filesystem/v3/doc/tutorial.html#Using-path-decomposition int main(int argc,
in my code i would like boost::shared_ptr not to call delete but call ptr->deleteMe()
I'm writing some code that utilizes the boost filesystem library. Here is an excerpt
I'm using boost::filesystem for cross-platform path manipulation, but this breaks down when calls need
We are using boost::filesystem in our application. I have a 'full' path that is
I have written the following code #include <iostream> #include <boost/asio.hpp> #include <boost/date_time/posix_time/posix_time.hpp> #include <boost/filesystem.hpp>
I use Boost.Serialization to serialize a std::map. The code looks like this void Dictionary::serialize(std::string

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.