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

  • SEARCH
  • Home
  • 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 8139945
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T11:59:50+00:00 2026-06-06T11:59:50+00:00

I am having some issues with a code that is occasionally and sporadically throwing

  • 0

I am having some issues with a code that is occasionally and sporadically throwing the following exception:

boost interprocess: no such file or directory

There are multiple codes accessing the same set of files, but some of the codes will move the files around to different directories in real time.
The codes handling and moving the files are using file locks, e.g.

boost::interprocess::file_lock

The process happening in code is the following:
1) Program 1 checks to see the file it wants to lock exists
2) If the above check passes, it then locks the file using file_lock

The problem, I think, is that between step 1 and 2, Program 2 can use boost::filesystem::rename on the file Program 1 is working on and move it.

If both programs are running simultaneously, is there any way to prevent this from happening?

  • 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-06-06T11:59:52+00:00Added an answer on June 6, 2026 at 11:59 am

    Don’t check if the file exists before locking. Instead, just attempt to lock it; if the file doesn’t exist, Boost will throw an interprocess_exception alerting you that the file is locked.

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

Sidebar

Related Questions

I'm having some issues getting file uploads to work correctly and the following code
I'm having some issues with some jQuery code, and I'm hoping and thinking that
Having some issues running my code local. I have host file setup like this:
So I'm having issues with some code that I've inherited. This code was building
I'm having some issues using the following code on user input: htmlentities($string, ENT_COMPAT, 'UTF-8');
I am having some issues throwing together a LINQ query that will join a
I'm having some issues with my code. This is probably due to some design
I am having some issues passing commands through to flash from javascript. My code
I am having some issues with logging. After reviewing JBoss Seam source code, I
I'm trying to convert some VB.net code into C# and having issues trying to

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.