Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: Grouch on May 15, 2016, 06:23:03 pm

Title: Running a CB project from an external drive
Post by: Grouch on May 15, 2016, 06:23:03 pm
I have a Code::Blocks 13.12 project on an Ubuntu Linux 14.04 (LTS) 64-bit computer.  I would like to make a copy to an external drive (a WD “My Passport” 500 MB  device) and to run the program from that drive.  I copy the program's directory and all subdirectores from the internal drive to the external drive using “cp -r” in a terminal window. I then start Code::Blocks, open the project on the external drive, “build” it (so that all modules are re-compiled). There are 0 errors. I then then attempt to run it, and it stops after 0 seconds. The permissions on the supposedly executable file in the bin/Release subdirectory  are -rw-------. In other words, the supposedly executable is not executable. And chmod cannot make it executable.

Can what I want to do be done? If so, what am I doing wrong? The procedure described works for making a backup copy on the internal disk, but what about an external drive and moving the project to other computers?

Thanks for your attention.
Title: Re: Running a CB project from an external drive
Post by: oBFusCATed on May 15, 2016, 08:05:59 pm
Probably the external driver is using a non-unix filesystem like fat or ntfs and thus doesn't support setting the executable flag.
The only fix for this is to mount it with special options/permissions which mark all files as executable.

But this is not a topic we can give you detailed help, please ask in a ubuntu/linux related forum/mailing list.
Title: Re: Running a CB project from an external drive
Post by: Grouch on May 15, 2016, 10:15:38 pm
Thanks. I had come to the same conclusion. I find that I can copy the "should-be-executable" file from the external drive to the internal drive, use "chmod 777 filename" to set its permissions, and then execute it. Alternatively, I can buy another external drive, and format it as ext3 or ext4 before using it. Then I can use it like an internal drive, but it will be useless for transferring data to Windows systems.