#include
#include
#include
#include
int main()
{
struct stat s;
char buf[256];
int filedes, retval, out, nread;
out = open("file_stat.txt",O_WRONLY|O_CREAT,S_IRUSR|S_IWUSR);
filedes = open("/etc/*",O_RDWR);
retval = fstat(filedes, &s);
nread = read(retval,buf,256);
write(out, buf, nread);
exit(0);
}