Acces denied while creating a cargo

Hi,

I'm new in rust development, i'm following the rust book, i'm currently in chapter 1.3 "Hello, Cargo".

When I try to build cargo using "cargo build", i get an acces denied :

error: failed to create directory C:\Users\Thomas\Documents\Projet\livre_rust\hello_cargo\target

Caused by:
Accès refusé. (os error 5)

So far i install rust using rustup and make a program printing "Hello, Word", did I miss something?

If you try to manually create that directory does it work? If so maybe your antivirus is preventing cargo from creating that directory?

Thank you for your answer,

I try to mannualy allow my antivirus to do it and it work, does that mean i have to shutdown my antivirus every time i need to do something with cargo? it do not sound likle a good idea

I read the suggestion as:

  • delete the target folder, or start a new project, to repeat the test from the beginning
  • run your cargo command to verify it fails the same as before
  • OPTION 1: in windows File Explorer, in the folder C:\Users\Thomas\Documents\Projet\livre_rust\hello_cargo try to make a new folder named target.
    • if file explorer prompts for admin access, this is a problem
  • OPTION 2: in command prompt, try to make the folder md C:\Users\Thomas\Documents\Projet\livre_rust\hello_cargo\target

You can repeat these steps with antivirus on or off, to understand when the access is denied for which methods (via cargo, via file explorer, via command prompt user command)

I tried the first option and windows ask for admin right, then I add all the bin file with everything rustup installed, as exeption in my antivirus and it look like it works fine.

I'll see if i still have an issue with my antivirus later