struct nfsdirent *next;
char *name;
uint64_t inode;
+
+ /* some extra fields we get for free through the READDIRPLUS3 call. You need libnfs-raw-nfs.h for these */
+ uint32_t type; /* NF3REG, NF3DIR, NF3BLK, ... */
+ uint32_t mode;
+ uint64_t size;
+ struct timeval atime;
+ struct timeval mtime;
+ struct timeval ctime;
};
/*
* nfs_readdir() never blocks, so no special sync/async versions are available
return;
}
nfsdirent->inode = entry->fileid;
+ if (entry->name_attributes.attributes_follow) {
+ nfsdirent->type = entry->name_attributes.post_op_attr_u.attributes.type;
+ nfsdirent->mode = entry->name_attributes.post_op_attr_u.attributes.mode;
+ nfsdirent->size = entry->name_attributes.post_op_attr_u.attributes.size;
+
+ nfsdirent->atime.tv_sec = entry->name_attributes.post_op_attr_u.attributes.atime.seconds;
+ nfsdirent->atime.tv_usec = entry->name_attributes.post_op_attr_u.attributes.atime.nseconds/1000;
+ nfsdirent->mtime.tv_sec = entry->name_attributes.post_op_attr_u.attributes.mtime.seconds;
+ nfsdirent->mtime.tv_usec = entry->name_attributes.post_op_attr_u.attributes.mtime.nseconds/1000;
+ nfsdirent->ctime.tv_sec = entry->name_attributes.post_op_attr_u.attributes.ctime.seconds;
+ nfsdirent->ctime.tv_usec = entry->name_attributes.post_op_attr_u.attributes.ctime.nseconds/1000;
+ }
+
nfsdirent->next = nfsdir->entries;
nfsdir->entries = nfsdirent;