diff options
| -rw-r--r-- | common/tuxcmd-vfs.h | 3 | ||||
| -rw-r--r-- | gvfs/gvfs.c | 3 | ||||
| -rw-r--r-- | libarchive/libarchive.c | 6 | ||||
| -rw-r--r-- | unrar/unrar.c | 7 | ||||
| -rw-r--r-- | zip/zip.cpp | 7 |
5 files changed, 19 insertions, 7 deletions
diff --git a/common/tuxcmd-vfs.h b/common/tuxcmd-vfs.h index 38c7b59..9689db2 100644 --- a/common/tuxcmd-vfs.h +++ b/common/tuxcmd-vfs.h @@ -128,7 +128,8 @@ struct TVFSItem { char *FName; char *FDisplayName; /* valid UTF-8 string */ guint64 iSize; - gint64 iPackedSize; /* set to -1 if plugin doesn't support this feature */ + gint64 iPackedSize; /* set to -1 if plugin doesn't support this feature */ + guint64 inode_no; /* return 0 if not supported */ guint32 m_time; guint32 a_time; guint32 c_time; diff --git a/gvfs/gvfs.c b/gvfs/gvfs.c index b88dcc4..91a64c0 100644 --- a/gvfs/gvfs.c +++ b/gvfs/gvfs.c @@ -37,7 +37,7 @@ G_FILE_ATTRIBUTE_STANDARD_SIZE "," G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET "," \ G_FILE_ATTRIBUTE_TIME_MODIFIED "," G_FILE_ATTRIBUTE_TIME_ACCESS "," G_FILE_ATTRIBUTE_TIME_CHANGED "," \ G_FILE_ATTRIBUTE_UNIX_MODE "," G_FILE_ATTRIBUTE_UNIX_UID "," \ - G_FILE_ATTRIBUTE_UNIX_GID + G_FILE_ATTRIBUTE_UNIX_GID "," G_FILE_ATTRIBUTE_UNIX_INODE struct TVFSGlobs { TVFSLogFunc log_func; @@ -655,6 +655,7 @@ g_file_info_to_TVFSItem (GFileInfo *info, struct TVFSItem *Item, GFile *referenc Item->c_time = g_file_info_get_attribute_uint64 (info, G_FILE_ATTRIBUTE_TIME_CHANGED); Item->iUID = g_file_info_get_attribute_uint32 (info, G_FILE_ATTRIBUTE_UNIX_UID); Item->iGID = g_file_info_get_attribute_uint32 (info, G_FILE_ATTRIBUTE_UNIX_GID); + Item->inode_no = g_file_info_get_attribute_uint64 (info, G_FILE_ATTRIBUTE_UNIX_INODE); // g_print ("(II) g_file_info_to_TVFSItem: type = %d\n", g_file_info_get_file_type (info)); // g_print ("(II) g_file_info_to_TVFSItem: UNIX_MODE = %d\n", Item->iMode); diff --git a/libarchive/libarchive.c b/libarchive/libarchive.c index 13039f2..535d565 100644 --- a/libarchive/libarchive.c +++ b/libarchive/libarchive.c @@ -273,6 +273,7 @@ VFSOpenArchive (struct TVFSGlobs *globs, const char *sName) struct TVFSItem *item; int r; char *s; + guint64 inode_no; globs->files = filelist_tree_new (); globs->vfs_filelist = vfs_filelist_new (globs->files); @@ -283,6 +284,7 @@ VFSOpenArchive (struct TVFSGlobs *globs, const char *sName) Result = libarchive_open (&a, globs->archive_path, globs->block_size); if (Result == cVFS_OK) { + inode_no = 0; for (;;) { entry = NULL; r = archive_read_next_header (a, &entry); @@ -299,12 +301,14 @@ VFSOpenArchive (struct TVFSGlobs *globs, const char *sName) } log ("found file: %s, mode = %x\n", archive_entry_pathname (entry), archive_entry_mode (entry)); + inode_no++; /* Create a TVFSItem entry and fill all info */ item = g_malloc0 (sizeof (struct TVFSItem)); item->iSize = (guint64) archive_entry_size (entry); item->iPackedSize = -1; /* no support */ + item->inode_no = inode_no; globs->total_size += item->iSize; item->iMode = archive_entry_mode (entry); @@ -360,7 +364,7 @@ VFSOpenArchive (struct TVFSGlobs *globs, const char *sName) } /* Add item to the global tree and continue with next file */ - filelist_tree_add_item (globs->files, s, item, archive_entry_pathname (entry), 0); + filelist_tree_add_item (globs->files, s, item, archive_entry_pathname (entry), inode_no); g_free (s); } archive_read_close (a); diff --git a/unrar/unrar.c b/unrar/unrar.c index f24aca5..f804ff2 100644 --- a/unrar/unrar.c +++ b/unrar/unrar.c @@ -326,6 +326,7 @@ VFSOpenArchive (struct TVFSGlobs *globs, const char *sName) TVFSResult Result; HANDLE PASCAL handle; struct RAROpenArchiveDataEx *archive_data; + guint64 inode_no; Result = cVFS_OK; @@ -336,6 +337,7 @@ VFSOpenArchive (struct TVFSGlobs *globs, const char *sName) globs->total_size = 0; globs->failed_passwd_callback = FALSE; globs->volume_missing_abort = FALSE; + inode_no = 0; fprintf (stderr, "(--) VFSOpenArchive: trying to open archive '%s'...\n", globs->archive_path); /* WARNING: do not use g_malloc0() here, leads to memory corruption */ @@ -372,11 +374,14 @@ VFSOpenArchive (struct TVFSGlobs *globs, const char *sName) while ((res = RARReadHeaderEx(handle, header)) == 0) { // printf(" header->FileName = '%s', Flags = 0x%x\n", header->FileName, header->Flags); + inode_no++; + /* Create a TVFSItem entry and fill all info */ struct TVFSItem *item = g_malloc0 (sizeof (struct TVFSItem)); item->iSize = (guint64)((guint64)(header->UnpSizeHigh * 0x100000000) + (guint64)header->UnpSize); item->iPackedSize = (guint64)((guint64)(header->PackSizeHigh * 0x100000000) + (guint64)header->PackSize); + item->inode_no = inode_no; globs->total_size += item->iSize; if ((header->Flags & 0x00e0 /* LHD_WINDOWMASK */ ) == 0x00e0 /* LHD_DIRECTORY */) item->ItemType = vDirectory; @@ -416,7 +421,7 @@ VFSOpenArchive (struct TVFSGlobs *globs, const char *sName) // g_print (" ansi = '%s'\n wide = '%ls'\n utf8 = '%s'\n", header->FileName, header->FileNameW, s); // Add item to the global list and continue with next file - filelist_tree_add_item (globs->files, s, item, header->FileName, 0); + filelist_tree_add_item (globs->files, s, item, header->FileName, inode_no); g_free (s); int PASCAL res2 = RARProcessFile (handle, RAR_SKIP, NULL, NULL); diff --git a/zip/zip.cpp b/zip/zip.cpp index adedfbc..4a07b01 100644 --- a/zip/zip.cpp +++ b/zip/zip.cpp @@ -183,8 +183,8 @@ struct ZIP_API CVFSZipActionCallback : public CZipActionCallback static void build_global_filelist (struct TVFSGlobs *globs) { - int iCount; - int i; + unsigned long int iCount; + unsigned long int i; CZipFileHeader *fh; struct TVFSItem *item; char *s; @@ -203,7 +203,7 @@ build_global_filelist (struct TVFSGlobs *globs) for (i = 0; i < iCount; i++) { fh = globs->zip->GetFileInfo (i); if (fh != NULL) - printf(" No: %i, '%s', IsDir: %i, Size: %lu, SystemAttr = 0x%lX, OriginalAttr = 0x%lX, encrypted = %d\n", + printf(" No: %lu, '%s', IsDir: %i, Size: %lu, SystemAttr = 0x%lX, OriginalAttr = 0x%lX, encrypted = %d\n", i, (LPCTSTR)fh->GetFileName(), fh->IsDirectory(), fh->m_uUncomprSize, fh->GetSystemAttr(), fh->GetOriginalAttributes(), fh->IsEncrypted()); } printf("\n\n"); @@ -216,6 +216,7 @@ build_global_filelist (struct TVFSGlobs *globs) item->iSize = (guint64) fh->m_uUncomprSize; item->iPackedSize = (guint64) fh->m_uComprSize; + item->inode_no = (guint64) (i + 1); if (fh->IsDirectory ()) item->ItemType = vDirectory; else |
