Prog#247: owner's permission


#1
/*
owner's permission 
Program#247
*/
#include<stdio.h>
main(int argc,char *argv[])
{
int i;
if(argc!=2)
{
printf("error: no.of arg");
return 0;
}
i=access(argv[1],0400);
if(i==0)
{
printf("owner has read permission");
i=access(argv[1],0200);
if(i==0)
printf("owner has write permission");
i=access(argv[1],0100);
if(i==0)
printf("owner has execute permission");
}
}