chmod not working
With Raspberry Pi standard Debian distro, I cannot get chmod to grant execution permission to C files compiled with gcc that do not have the ".exe" extension. I run chmod as the owner (pi) in a directory owned by me (pi).
If I compile the C file with the ".exe" extension, the execution permission miraculously applies without my use of chmod. How can I make chmod work without the ".exe" extension? |
How about some further details:
Code:
$ ls -l <executable-file-name> Code:
$ chmod +x <executable-file-name> When you say it won't grant, are you sure? For instance, if the local path is not in your $PATH variable, that being either the path as fully defined or ".", then trying to run an executable even locally may not work or be auto-recognized. An example of when you try to run it and what happens would be helpful too. You should be able to just do: Code:
$ ./<executable-file-name> |
Would you share with us your chmod command and the command you use to compile the source file?
The compiler should output an executable file. From man gcc: Code:
-o file |
Quote:
Check this out: Code:
$ cat test.c Code:
$ ls -lr | head -2 Code:
$ gcc -o test test.c Code:
$ ls -lr | head -3 Code:
$ ./test Best regards, HMW |
Quote:
I bet what you did was use the -c option which saves an object file - not an executable. Executables don't need a ".exe" extension. Executable is determined strictly by the access control bit. |
chmod not working
The problem turned out to be the vfat file format on the USB drive I was using. Format vfat does not respond to chmod execution permission changes. I switched over to the ext4 formatted SD card on my Raspberry Pi and all works well. Thanks to all who helped this newbie.
|
Quote:
|
All times are GMT -5. The time now is 12:26 AM. |