From: hamza zia <[email protected]>

Inode and device information is added in the file_info struct, it can be
very useful for a plugin that handles file caching.
---
 src/include/mk_file.h | 3 +++
 src/mk_file.c         | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/src/include/mk_file.h b/src/include/mk_file.h
index 5c91d1a..89e8067 100644
--- a/src/include/mk_file.h
+++ b/src/include/mk_file.h
@@ -27,6 +27,9 @@ struct file_info
     off_t size;
     time_t last_modification;

+    ino_t inode;
+    dev_t device;
+
     /* Suggest flags to open this file */
     int flags_read_only;

diff --git a/src/mk_file.c b/src/mk_file.c
index dcd067b..ed9da01 100644
--- a/src/mk_file.c
+++ b/src/mk_file.c
@@ -71,6 +71,9 @@ int mk_file_get_info(const char *path, struct file_info 
*f_info)
     f_info->size = target.st_size;
     f_info->last_modification = target.st_mtime;

+    f_info->inode = target.st_ino;
+    f_info->device = target.st_dev;
+
     if (S_ISDIR(target.st_mode)) {
         f_info->is_directory = MK_TRUE;
         f_info->is_file = MK_FALSE;
--
1.8.1.2

_______________________________________________
Monkey mailing list
[email protected]
http://lists.monkey-project.com/listinfo/monkey

Reply via email to