X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=examples%2Fnfs-ls.c;fp=examples%2Fnfs-ls.c;h=f6b223d2fdf3ceb012679278cc64545d26435c67;hb=479302f72943be9f45d6b18c82c5502be12efa5a;hp=e87ffa82b91cc11162d52629037398e02a0bd4df;hpb=c8f0bac1bbe9b0e70607979d51b74e59304fcc41;p=deb_libnfs.git diff --git a/examples/nfs-ls.c b/examples/nfs-ls.c index e87ffa8..f6b223d 100644 --- a/examples/nfs-ls.c +++ b/examples/nfs-ls.c @@ -91,7 +91,7 @@ void process_dir(struct nfs_context *nfs, char *dir, int level) { struct nfsdirent *nfsdirent; struct statvfs svfs; struct nfsdir *nfsdir; - struct stat st; + struct nfs_stat_64 st; if (!level) { printf("Recursion detected!\n"); @@ -111,13 +111,13 @@ void process_dir(struct nfs_context *nfs, char *dir, int level) { } snprintf(path, 1024, "%s/%s", dir, nfsdirent->name); - ret = nfs_stat(nfs, path, &st); + ret = nfs_stat64(nfs, path, &st); if (ret != 0) { fprintf(stderr, "Failed to stat(%s) %s\n", path, nfs_get_error(nfs)); continue; } - switch (st.st_mode & S_IFMT) { + switch (st.nfs_mode & S_IFMT) { #ifndef WIN32 case S_IFLNK: printf("l"); @@ -137,28 +137,28 @@ void process_dir(struct nfs_context *nfs, char *dir, int level) { break; } printf("%c%c%c", - "-r"[!!(st.st_mode & S_IRUSR)], - "-w"[!!(st.st_mode & S_IWUSR)], - "-x"[!!(st.st_mode & S_IXUSR)] + "-r"[!!(st.nfs_mode & S_IRUSR)], + "-w"[!!(st.nfs_mode & S_IWUSR)], + "-x"[!!(st.nfs_mode & S_IXUSR)] ); printf("%c%c%c", - "-r"[!!(st.st_mode & S_IRGRP)], - "-w"[!!(st.st_mode & S_IWGRP)], - "-x"[!!(st.st_mode & S_IXGRP)] + "-r"[!!(st.nfs_mode & S_IRGRP)], + "-w"[!!(st.nfs_mode & S_IWGRP)], + "-x"[!!(st.nfs_mode & S_IXGRP)] ); printf("%c%c%c", - "-r"[!!(st.st_mode & S_IROTH)], - "-w"[!!(st.st_mode & S_IWOTH)], - "-x"[!!(st.st_mode & S_IXOTH)] + "-r"[!!(st.nfs_mode & S_IROTH)], + "-w"[!!(st.nfs_mode & S_IWOTH)], + "-x"[!!(st.nfs_mode & S_IXOTH)] ); - printf(" %2d", (int) st.st_nlink); - printf(" %5d", st.st_uid); - printf(" %5d", st.st_gid); - printf(" %12" PRId64, st.st_size); + printf(" %2d", (int)st.nfs_nlink); + printf(" %5d", (int)st.nfs_uid); + printf(" %5d", (int)st.nfs_gid); + printf(" %12" PRId64, st.nfs_size); printf(" %s\n", path + 1); - if (recursive && (st.st_mode & S_IFMT) == S_IFDIR) { + if (recursive && (st.nfs_mode & S_IFMT) == S_IFDIR) { process_dir(nfs, path, level - 1); } }