Results 1 to 10 of 10

Thread: Code::Blocks permission denied

  1. #1
    Join Date
    Apr 2012
    Beans
    4

    Post Code::Blocks permission denied

    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

  2. #2
    Join Date
    Mar 2011
    Location
    Pizza Hut
    Beans
    1,211
    Distro
    Kubuntu 13.10 Saucy Salamander

    Re: Code::Blocks permission denied

    Make sure you're the owner of the files. If you're not, you can run this:
    Code:
    sudo chown usrname:username /path/to/your/file
    Also make sure it's executable:
    Code:
    chmod +x /path/to/your/file
    Last edited by dniMretsaM; April 13th, 2012 at 04:30 PM.

  3. #3
    Join Date
    Apr 2012
    Beans
    4

    Re: Code::Blocks permission denied

    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???

  4. #4
    Join Date
    Apr 2012
    Beans
    4

    Re: Code::Blocks permission denied

    Quote Originally Posted by dniMretsaM View Post
    Make sure you're the owner of the files. If you're not, you can run this:
    Code:
    sudo chown usrname:username /path/to/your/file
    Also make sure it's executable:
    Code:
    chmod +x /path/to/your/file
    Got that code to work now but it still shows the same error message? Any other Ideas? Cheers

  5. #5
    Join Date
    Nov 2010
    Location
    India
    Beans
    Hidden!
    Distro
    Ubuntu 15.10 Wily Werewolf

    Re: Code::Blocks permission denied

    Quote Originally Posted by 8163jb View Post
    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 ?
    Dont miss anything even it is small. one small pin is enough to bring down a man.


  6. #6
    Join Date
    Apr 2012
    Beans
    4

    Re: Code::Blocks permission denied

    Quote Originally Posted by raja.genupula View Post
    in which partition it was saved ?
    EXT or FAT,NTFS ?
    I don't know? How would I find out?

  7. #7
    Join Date
    Nov 2010
    Location
    India
    Beans
    Hidden!
    Distro
    Ubuntu 15.10 Wily Werewolf

    Re: Code::Blocks permission denied

    where you have saved that file ? Home directoy or some other partitions of your HDD
    Dont miss anything even it is small. one small pin is enough to bring down a man.


  8. #8
    Join Date
    May 2007
    Location
    Leeds, UK
    Beans
    1,664
    Distro
    Ubuntu 13.10 Saucy Salamander

    Re: Code::Blocks permission denied

    Quote Originally Posted by 8163jb View Post
    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:

    Code:
    chown username.groupname <filename>
    This sets the owner and group of a file to username and groupname respectively.

    Code:
    chmod +x <filename>
    This adds execute permissions (for owner, group and world).

  9. #9
    Join Date
    Feb 2008
    Location
    Sri Lanka
    Beans
    242
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Lightbulb FIX For Code::Blocks permission denied

    Quote Originally Posted by raja.genupula View Post
    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
    In the past I built solutions looking through a Window. But now I see how big the world is.

  10. #10
    Join Date
    Feb 2013
    Beans
    1

    Re: Code::Blocks permission denied

    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 ...


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •