PDA

View Full Version : Code::Blocks permission denied



8163jb
April 13th, 2012, 04:22 PM
Hey, I am a newbie to all this and I have just installed code::blocks. When I try to compile and run simple programs it gives me the error message 'sh: /path/to/my/file: permission denied'. I have read around a bit and tried varous solutions from other forums but none seem to work. I am running ubuntu 10.4. Any help? Cheers

dniMretsaM
April 13th, 2012, 04:26 PM
Make sure you're the owner of the files. If you're not, you can run this:

sudo chown usrname:username /path/to/your/file

Also make sure it's executable:

chmod +x /path/to/your/file

8163jb
April 13th, 2012, 04:54 PM
Cheers, but the usrname:username code doesn't seem to work??? I have replaced the bit which says username with my username but it still doesn't do it???

8163jb
April 13th, 2012, 04:58 PM
Make sure you're the owner of the files. If you're not, you can run this:

sudo chown usrname:username /path/to/your/fileAlso make sure it's executable:

chmod +x /path/to/your/file

Got that code to work now but it still shows the same error message? Any other Ideas? Cheers

raja.genupula
April 13th, 2012, 05:02 PM
Hey, I am a newbie to all this and I have just installed code::blocks. When I try to compile and run simple programs it gives me the error message 'sh: /path/to/my/file: permission denied'. I have read around a bit and tried varous solutions from other forums but none seem to work. I am running ubuntu 10.4. Any help? Cheers

in which partition it was saved ?
EXT or FAT,NTFS ?

8163jb
April 13th, 2012, 05:07 PM
in which partition it was saved ?
EXT or FAT,NTFS ?
I don't know? How would I find out?

raja.genupula
April 14th, 2012, 06:53 AM
where you have saved that file ? Home directoy or some other partitions of your HDD

r-senior
April 14th, 2012, 09:34 AM
Got that code to work now but it still shows the same error message? Any other Ideas? Cheers
Can you find the file using the file manager? (It's called Nautilus).

Right-click on it and choose Properties. Then go to the Permissions tab.

It should show that you are the owner of the file and that you have read and write access. Also, if you want to run it as a program, that the "Allow executing file as program" box is checked.

The commands you were typing were:


chown username.groupname <filename>

This sets the owner and group of a file to username and groupname respectively.


chmod +x <filename>

This adds execute permissions (for owner, group and world).

itsols
May 13th, 2012, 11:57 AM
in which partition it was saved ?
EXT or FAT,NTFS ?

Your question makes sense. I had the SAME problem when running Code::Blocks on Ubuntu and my source folder was on an NTFS partision.

I could not do any permission changes there either - naturally, it's not EXT.

I solved it by keeping my cpp project files in the same partition as Ubuntu (having EXT) and it works now.

Hope others benefit by this :)

xadix
February 10th, 2013, 10:37 PM
simple way I've ...
You just open a new file using ( Ctrl + Shift + N )
Than save it using ( Ctrl + S )
Than name it *** And after the name Just put ( .cpp ) ***

Thats all ..
Do programming and Run ..
Have Fun ...

:guitar: