title: Rust - shared_memory crate returns MapOpenFailed(2) - What to do
body: <p>Recently, I decided to try out the &quot;shared_memory&quot; crate in Rust (<a href="https://crates.io/crates/shared_memory" rel="nofollow noreferrer">crate</a>)</p>
  <p>I first compiled the Event example (<a href="https://github.com/elast0ny/shared_memory-rs/blob/master/examples/event.rs" rel="nofollow noreferrer">src</a>) and it worked. I launched one instance of it, and it began listening for a Event signal. I launched another instance and it sent a signal, then both instances cleanly quit. I was able to do this twice without fail.</p>
  <p>Then, I opened a instance and it began listening, and then I accidentally closed it. Every time I launched it again, it would return the same message:</p>
  <p>Error: MapOpenFailed(2)</p>
  <p>I tried changing the flink text, and it worked again. However, I tried listening and then closed it. Now the original and new flink name both returned that same error message.</p>
  <p>I am running Windows 10 so I looked up Windows error codes and 2 means file not found. I first tried adding force_create_flink(). I also tried removing the &quot;LinkExists&quot; branch on the match. Both returned, &quot;Error: LinkExists&quot;</p>
  <p>I am confused. So the link exists but Windows can't find it? That doesn't make much since so why is this error code happening and what can I do to fix it?</p>
  <p>I am running Windows 10 Build 19041.450. Rustc is version 1.44.1. I am using the latest versions of shared_memory and raw_sync (0.11.1 and 0.1.2 respectively)</p>