You are not logged in.

#1 2019-07-31 17:53:16

Jooshhy
Member
Registered: 2019-07-31
Posts: 4

Visiual Studio Terminal getting 'permission denied' [SOLVED]

Hello I'm quite new to Arch linux and Linux itself. I am in the progress of making sure that all my applications or alternative ones work but I'm getting issues with visual studio.

I have created a directory in my documents for my c++ files and I am able to compile and run them through a terminal emulator with no issues.  In visual studio I'm getting Permission denied.  It seems to be compiling with visual studio fine but not running the program after.

Visual Studio

"[test@testarch Learning C]$ /home/test/Documents/Learning\ C/myfirst.cpp
bash: /home/test/Documents/Learning C/myfirst.cpp: Permission denied"
 

Any suggestions would be great smile

Last edited by Jooshhy (2019-07-31 22:50:36)

Offline

#2 2019-07-31 19:12:41

summerer
Member
From: Germany
Registered: 2014-01-25
Posts: 54

Re: Visiual Studio Terminal getting 'permission denied' [SOLVED]

I don't know why you are getting a permission denied. You could try navigating in the terminal to /home/test/Documents/Learning\ C/ using cd and showing us the output using ls -l for example.

Also, wouldn't you usually compile the .cpp file which creates an executable which you would then execute?

Cheers Tim

Offline

#3 2019-07-31 19:30:17

Jooshhy
Member
Registered: 2019-07-31
Posts: 4

Re: Visiual Studio Terminal getting 'permission denied' [SOLVED]

Here is the results of the ls -l to see the permissions of the directory. If i understand it correctly the user does have permission to execute the program 

total 28
-rwxr-xr-x 1 test users 17184 Jul 31 17:09 myfirst
-rw-r--r-- 1 test users   196 Jul 30 21:18 myfirst.cpp

Yes I could do that as I tried it in the directory to check the accounts permissions and to make sure they had permission to compile and run the program. Visual Studio has a inbuilt terminal to test certain parts of the code. I just find it weird how it access to compile the program but not run it and works fine if I run it in terminator (outside of visual studio)

Last edited by Jooshhy (2019-07-31 19:36:09)

Offline

#4 2019-07-31 19:46:32

summerer
Member
From: Germany
Registered: 2014-01-25
Posts: 54

Re: Visiual Studio Terminal getting 'permission denied' [SOLVED]

Great, that it works in the terminal, at least. I have had my fair share of weird issues in VS Code sometimes.
I don't really understand your issue in VS Code maybe you could explain it for me again. However, for quickly "running" a simple file like .java or .cpp, I recommend the extension "Code Runner" but it's not perfect.

Offline

#5 2019-07-31 20:15:13

loqs
Member
Registered: 2014-03-06
Posts: 17,904

Re: Visiual Studio Terminal getting 'permission denied' [SOLVED]

home/test/Documents/Learning\ C/myfirst.cpp
bash: /home/test/Documents/Learning C/myfirst.cpp: Permission denied"

Executing the source file which is not marked execute failed.  Did you intend to execute the compiled binary myfirst instead?

Offline

#6 2019-07-31 22:14:20

Jooshhy
Member
Registered: 2019-07-31
Posts: 4

Re: Visiual Studio Terminal getting 'permission denied' [SOLVED]

I tried to mark the entire directory to allow the user to be able to execute in that directory but it appears it doesn't work and only does existing files. So it is definitely me setting permissions wrong and not VS.

How would I set permission to that folder to always allow it to be executed by that user if a new file is created? As the second I make any changes to the code it's going to recompile and mark it as not able to execute.

Offline

#7 2019-07-31 22:50:10

Jooshhy
Member
Registered: 2019-07-31
Posts: 4

Re: Visiual Studio Terminal getting 'permission denied' [SOLVED]

Fixed the issue was a mix of permissions issue and the plugins in visual studio. The plugins that allowed me to compile and run through VS was C++ Intellsense and Code Runner.

Thanks for the help smile

Last edited by Jooshhy (2019-07-31 22:52:08)

Offline

Board footer

Powered by FluxBB