need help in this code

Discussion of programming on Linux, including shell scripting, perl, python, c/c++, mono, java. Whatever tickles your fancy.
khan001
Cadet
Posts: 3
Joined: Sat Feb 05, 2011 10:56 pm

need help in this code

Postby khan001 » Fri Feb 11, 2011 2:50 am

i want to write a code which determines whether a file is executable or relocatable.....i have try this code but its now working ...


#include<stdio.h>
#include<elf.h>
int main()
{
int fd;
elf32_ehdr myhdr;
fd=open("abc.c");
if (myhdr.e_type==ET_RELl)
{
printf(:relocatable");
if (myhdr.e_type==ET_EXEC)
printf(executable");


else
printf(:other type");

return(0);
}

soni
Naik
Posts: 70
Joined: Sat Oct 04, 2003 1:44 pm
Location: Karachi
Contact:

Postby soni » Sat Feb 12, 2011 8:34 pm

Please do not open M$Windoze.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 1 guest