/Home/aooliver/work/stagersvc/org.glite.data.lcg_gfal/src/gfal_testdir.c File Reference

#include <stdio.h>
#include "gfal_api.h"

Go to the source code of this file.

Functions

 main (int argc, char **argv)


Function Documentation

main int  argc,
char **  argv
 

Definition at line 12 of file gfal_testdir.c.

References gfal_closedir(), gfal_opendir(), gfal_readdir(), and gfal_readdir64().

00013 {
00014         struct dirent *d;
00015         DIR *dir;
00016         int rc;
00017 
00018         if (argc != 2) {
00019                 fprintf (stderr, "usage: %s filename\n", argv[0]);
00020                 exit (1);
00021         }
00022 
00023         if ((dir = gfal_opendir (argv[1])) == NULL) {
00024                 perror ("gfal_opendir");
00025                 exit (1);
00026         }
00027 
00028 #if defined(__USE_FILE_OFFSET64)
00029         while (d = gfal_readdir64 (dir)) {
00030 #else
00031         while (d = gfal_readdir (dir)) {
00032 #endif
00033                 printf ("%s\n", d->d_name);
00034         }
00035 
00036         if (gfal_closedir (dir) < 0) {
00037                 perror ("gfal_closedir");
00038                 exit (1);
00039         }
00040         exit (0);
00041 }


Generated on Fri Sep 8 20:20:48 2006 for GFAL by  doxygen 1.4.6