6 #include <libsmbclient.h>
9 main(int argc, char * argv[])
14 struct dirent * dirent;
18 for (fputs("path: ", stdout), p = fgets(buf, sizeof(buf), stdin);
19 p != NULL && *p != '\n' && *p != '\0';
20 fputs("path: ", stdout), p = fgets(buf, sizeof(buf), stdin))
22 if ((p = strchr(buf, '\n')) != NULL)
27 printf("Opening (%s)...\n", buf);
29 if ((dir = opendir(buf)) == NULL)
31 printf("Could not open directory [%s]: \n",
32 buf, strerror(errno));
36 while ((dirent = readdir(dir)) != NULL)
38 printf("%-30s", dirent->d_name);
39 printf("%-30s", dirent->d_name + strlen(dirent->d_name) + 1);