🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.unix.programmer
1 messages
1 total messages Started by System Administrator Tue, 07 Apr 1998 00:00
NeXt dirent functions??
#3557
Author: System Administrator
Date: Tue, 07 Apr 1998 00:00
49 lines
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/
---------------------------------------------------------------------------
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads