Back to index

glibc  2.9
Functions
dir.c File Reference
#include <stdio.h>
#include <sys/types.h>
#include <dirent.h>

Go to the source code of this file.

Functions

int main (void)

Function Documentation

int main ( void  )

Definition at line 8 of file dir.c.

{
  DIR *dp;
  struct dirent *ep;

  dp = opendir ("./");
  if (dp != NULL)
    {
      while (ep = readdir (dp))
       puts (ep->d_name);
      (void) closedir (dp);
    }
  else
    perror ("Couldn't open the directory");

  return 0;
}

Here is the call graph for this function: