0

I am a newbie to ubuntu and trying to compile and run C++ programs in Ubuntu terminal and in CodeBlocks (Ubuntu 14.04). I get the permission denied error when executing. I understand that the file/folder permissions are the issue here. I tried using chmod to allow executable permission to my cpp folder, which is a folder in one of my my windows partitions (win 7, dual booting).

chmod -R 777 /media/sandun/Data/cpp/

It doesn't give an error but not working. I searched more and more and found that I should mount the partition in ubuntu which is given in the link below.
.exe file permission fail
I didn't try that yet. I am wondering whether it will work or effect the file system on windows partition. Or is there any other alternative?
Thanks a lot.

2 Answers2

0

I'd suggest coping the files into your local home directory using:

cp -r /media/sandun/Data ~/

This should fix the permission (and owner-ship) issues.

Then use the copied data in the following directory: ~/Data/cpp

Note: ~ refers to your home directory (something like /home/username/Data/cpp)

muru
  • 197,895
  • 55
  • 485
  • 740
Yaron
  • 13,173
  • thank you very much for the help. Is there any way to use these files both in windows and ubuntu? I mean without having to copy each time. – amsandun Mar 13 '17 at 10:27
  • I guess so, you'll need to edit your question, and add enough details in order to analysis your problem. e.g. the command you are running, and the full error message, and the output of ls -lsa /media/sandun/Data/cpp/ – Yaron Mar 13 '17 at 10:54
0

This might not be a permissions issue. /media/Sandun/data may be mounted with the noexec flag, which prevents execution of any binaries regardless of permissions. Check the output of mount to confirm this. If that's the problem, sudo mount -o remount,exec /media/Sandun/data will fix it.