pwd = getpwuid(buf.st_uid);
grp = getgrgid(buf.st_gid);
if(NULL == pwd)
{
printf("pw is null \n");
exit(1);
}
if(NULL == grp)
{
printf("grp is null \n");
exit(1);
}
// show file type
printf("%c",type);
// show permission of usr, grout and other
while(i<9)
{
printf("%c",permission[i]);
i++;
}