[LCP]directory test

Joachim Bauernberger bj at gmx.net
Tue Jul 9 19:29:05 UTC 2002


Hi,

I have some questions regarding opendir.
After calling it I would like to check if the directory is a symbolic 
name or not. However compiling this gives me the following error:

dereferencing pointer to incomplete type


int
islink(int fd)
{
    struct stat st;
    if ((fstat(fd,&st))<0) return -1;
    if (S_ISLNK(st.st_mode)) return 1;
    else return 0;
}


void
otherfunc(void)
{
 DIR *d;
  ....
  d = opendir (abs_outdir);
  ...
  if (islink(d->dd_fd)!=0)  return 1;
  ....
}

Somebody know how to check for something like this?

Thanks & Best regards,
Joachim Bauernberger
-- 
http://mXscan.org/pgp/joachim.html






More information about the linuxCprogramming mailing list