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

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2003 by CERN
00003  */
00004 
00005 /*
00006  * @(#)$RCSfile: gfal_testdir.c,v $ $Revision: 1.1.1.1 $ $Date: 2006/09/06 08:54:53 $ CERN Jean-Philippe Baud
00007  */
00008 
00009 #include <stdio.h>
00010 #include "gfal_api.h"
00011 
00012 main(int argc, char **argv)
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:47 2006 for GFAL by  doxygen 1.4.6