Article View: comp.unix.programmer
Article #3557NeXt dirent functions??
From: System Administrator
Date: Tue, 07 Apr 1998 00:00
Date: Tue, 07 Apr 1998 00:00
49 lines
2308 bytes
2308 bytes
Hi, I write a C program and have compiled it over hte years on many
unixes (linux,sunos,sysv,irix,osf).
However now is the first time that someone is try to compile it on NeXt.
I realized that they needed <sys/dir.h>, unlike bsd systems, so I included
that. (btw, what check can i do to check for next to include that..like
#if defined(NEXT) #include <sys/dir.h> ??
When they compile with gcc they seem to get the following errors.
server.c:1892: warning: assignment from incompatible pointer type
server.c:1895: dereferencing pointer to incomplete type
the relevant code reads (with while() being line 1892)....
sprintf(z_mess,"%s",USERDIR);
strncpy(filerid,z_mess,FILE_NAME_LEN);
dirp=opendir((char *)filerid);
if (dirp == NULL)
{
strcpy(z_mess,"SYSTEM: Directory information not found");
print_to_syslog(z_mess);
return;
}
while ((dp = readdir(dirp)) != NULL)
{
sprintf(small_buffer,"%s",dp->d_name);
where dp is declared as: struct dirent *dp;
and dirp is declared as: DIR *dirp;
any help is appreciated. please email, if possible
Thanx,
-Cygnus
---------------------------------------------------------------------------
Anthony J. Biacco Network Administrator/Engineer
.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-.
"The only way to predict the future, is to invent it."
.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-.
admin@intergrafix.net cygnus@ncohafmuta.com
http://cygnus.ncohafmuta.com/
---------------------------------------------------------------------------
Technical Details
Message-ID:
<6gd9a3$b40$1@ns2.intergrafix.net>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f8c9b,27a8c0b24c0c2912,start X-Google-Attributes: gidf8c9b,public X-Google-Thread: f65d0,27a8c0b24c0c2912,start X-Google-Attributes: gidf65d0,public X-Google-Thread: fc89c,27a8c0b24c0c2912,start X-Google-Attributes: gidfc89c,public From: System Administrator <admin@athena.intergrafix.net> Subject: NeXt dirent functions?? Date: 1998/04/07 Message-ID: <6gd9a3$b40$1@ns2.intergrafix.net> X-Deja-AN: 341694833 Organization: Intergrafix Internet Services Newsgroups: comp.unix.programmer,comp.unix.questions,gnu.gcc