|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T t
Length: 1036 (0x40c) Types: TextFile Names: »testdir.c«
└─⟦3d0c2be1b⟧ Bits:30001254 ISODE-5.0 Tape └─⟦eba4602b1⟧ »./isode-5.0.tar.Z« └─⟦d3ac74d73⟧ └─⟦this⟧ »isode-5.0/dirent/testdir.c« └─⟦2d1937cfd⟧ Bits:30007241 EUUGD22: P.P 5.0 └─⟦35176feda⟧ »EurOpenD22/isode/isode-6.tar.Z« └─⟦de7628f85⟧ └─⟦this⟧ »isode-6.0/dirent/testdir.c«
/* testdir -- basic test for C library directory access routines last edit: 25-Apr-1987 D A Gwyn */ #include <sys/types.h> #include <stdio.h> #include "usr.dirent.h" extern void exit(); extern int strcmp(); main( argc, argv ) int argc; register char **argv; { register DIR *dirp; register struct dirent *dp; int nerrs = 0; /* total not found */ if ( (dirp = opendir( "." )) == NULL ) { (void)fprintf( stderr, "Cannot open \".\" directory\n" ); exit( 1 ); } if (argc == 1) { while (dp = readdir (dirp)) printf ("ino=%d len=%d name=\"%s\"\n", dp -> d_ino, strlen (dp -> d_name), dp -> d_name); (void) closedir (dirp); exit (0); } while ( --argc > 0 ) { ++argv; while ( (dp = readdir( dirp )) != NULL ) if ( strcmp( dp->d_name, *argv ) == 0 ) { (void)printf( "\"%s\" found.\n", *argv ); break; } if ( dp == NULL ) { (void)printf( "\"%s\" not found.\n", *argv ); ++nerrs; } rewinddir( dirp ); } (void)closedir( dirp ); exit( nerrs ); }