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

main(int argc, char **argv)
{
    DIR	*dirp;
    struct direct *dp;
    char *name;

    if (argc < 2) name = "";
    else name = argv[1];

    if (!(dirp = opendir(name))) {
	fprintf(stderr, "Can't opendir(%s)\n", name);
	exit(1);
    }

    while (dp = readdir(dirp))
	puts(dp->d_name);

    closedir(dirp);
}
