You are not logged in.

#1 2023-02-07 17:41:27

abdullah_faik
Member
Registered: 2023-01-27
Posts: 9

VScode problems

Hi guys i need help with vscode the problem is i can't run the code it gives me permession denied
so i tried to run it using sudo but it gives me this message

You are trying to start Visual Studio Code as a super user which isn't recommended. If this was intended, please add the argument `--no-sandbox` and specify an alternate user data directory using the `--user-data-dir` argument..

i have tried some thins like first
i edit the desktop file in /usr/share/application by adding sudo before excution path
when i try to run command

 c++ file.cpp 

it gives me o.out file thats mean the files debuged right

Offline

#2 2023-02-07 18:07:10

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,257

Re: VScode problems

Stop slamming sudo in front of every message that gives you an information about denied permissions, it can and will end up harmful if you make a habit out of that. VSCode actively and properly prevents you from running it as root, so stop doing and thinking about doing that and fix the actual problem.

What code are you trying to run where exactly? Chances are your out file just lacks the executable bit which you can add with chmod +x, I'm assuming this is related to https://bbs.archlinux.org/viewtopic.php … 8#p2081718 which is why I'd strongly suggest you properly learn about file permissions and how and in what way they interact with your system/your files: https://wiki.archlinux.org/title/File_p … attributes - read that, all of it.

Last edited by V1del (2023-02-07 18:09:41)

Offline

#3 2023-02-07 23:44:00

lfitzgerald
Member
Registered: 2021-07-16
Posts: 175

Re: VScode problems

This is phrased as if it's a question about VS code (which has nothing to do with Arch) but I suspect the real question is "how do I run C++ code" (which also has nothing to do with Arch).

it gives me o.out file thats mean the files debuged right

Uh... What?

Last edited by lfitzgerald (2023-02-07 23:45:42)

Offline

#4 2023-02-08 00:06:02

headkase
Member
Registered: 2011-12-06
Posts: 1,986

Re: VScode problems

abdullah_faik wrote:

Hi guys i need help with vscode the problem is i can't run the code it gives me permession denied
so i tried to run it using sudo but it gives me this message

You are trying to start Visual Studio Code as a super user which isn't recommended. If this was intended, please add the argument `--no-sandbox` and specify an alternate user data directory using the `--user-data-dir` argument..

i have tried some thins like first
i edit the desktop file in /usr/share/application by adding sudo before excution path
when i try to run command

 c++ file.cpp 

it gives me o.out file thats mean the files debuged right

I think you need this: https://code.visualstudio.com/docs/languages/cpp
To get started, then see the Debugging link off of that page (read it all!) and you should be set up.

Offline

#5 2023-02-09 14:37:35

abdullah_faik
Member
Registered: 2023-01-27
Posts: 9

Re: VScode problems

V1del wrote:

Stop slamming sudo in front of every message that gives you an information about denied permissions, it can and will end up harmful if you make a habit out of that. VSCode actively and properly prevents you from running it as root, so stop doing and thinking about doing that and fix the actual problem.

What code are you trying to run where exactly? Chances are your out file just lacks the executable bit which you can add with chmod +x, I'm assuming this is related to https://bbs.archlinux.org/viewtopic.php … 8#p2081718 which is why I'd strongly suggest you properly learn about file permissions and how and in what way they interact with your system/your files: https://wiki.archlinux.org/title/File_p … attributes - read that, all of it.

i don't think the problem is not here
because when i running the code it give me compiled successfully and vs code genrate a file to excute it but it gives me permession denied i think the problem in this file
this file has no extention

Offline

#6 2023-02-09 14:42:22

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,257

Re: VScode problems

if you get an out file and it lacks the permission to execute it you get permission denied on an attempt to execute it. Whether files have extensions or not doesn't matter this isn't Windows, file extensions aren't actually doing much on a linux system.

Get more concrete, what exactly are you doing where are you compiling the file, what is the output file, what is the output of

stat $outputfile$ #$outputfile$ means nothing here, you need to insert the path of the actual file that's giving you issues

if you slam sudo in front of the failure of executing a file that doesn't have the executable bit set you will still get permission denied even as root.

Offline

Board footer

Powered by FluxBB