Click to See Complete Forum and Search --> : Changing the 'mode' of files


George Kilroy
12-27-2001, 02:46 PM
I have two elf binaries that won't run. I am told they were compiled for Linux. Someone told me to type ls -l to find out if they are set as executable and to check the ownership.

The first is set as -rw-r-----. In xterm this shows up in plain black letters indicating that it is non-executable. When I try to execute it I get the message 'permission denied.'

The second is set as -rwxr-x---. In xterm it shows up green with a '*' indicating that it is executable, but when I try to execute it with './nameofprogram' I get a bash error saying that the file or directory doesn't exist.

Both files have ownership set to my username.

What should I do to get these working? Do I change the mode of the files somehow?

thanks

slapNUT
12-27-2001, 04:41 PM
The first file is not executable. If it is an executable file then you need to make it executable:
chmod +x <filename>
The second file should execute as long as you are the owner or the group for the file. Also you must be in the directory the file is in to do the ./<filename> otherwise you need to supply the full path. If all the above are true then possibly the file is corrupted or not really an ELF binary. You can look at it with a hex editor and the ELF ID should be in the first couple bytes.

George Kilroy
12-27-2001, 07:24 PM
Thanks, I got the first file showing up as an executable now. Both of them still won't run though. I am in the very same folder and both files have permissions set to my username. They both print 'no file or directory' when I try to run them.

I opened them up in Midnight Commander (text version) and the first line of both files starts with ".ELF..........".

The Whizzard
12-27-2001, 11:42 PM
but when I try to execute it with './nameofprogram' I get a bash error saying that the file or directory doesn't exist.
Have you tried without the './'? Normaly you only need the './' if an executable file doesn't have executable permissions.

George Kilroy
12-28-2001, 12:49 AM
Without the './' both programs print 'command not found.'

George Kilroy
12-29-2001, 03:33 PM
Doesn't anybody know at least where I can get info on how to get my programs working? I've been trying for at least two months to get these two to work. Besides posting here I've looked in numberous places and posted messages on a forum specifically for this program (but I can't get ahold of the person who made the linux port).

[ 29 December 2001: Message edited by: George Kilroy ]