gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r20626 - gnunet-gtk/src/fs


From: gnunet
Subject: [GNUnet-SVN] r20626 - gnunet-gtk/src/fs
Date: Tue, 20 Mar 2012 09:27:43 +0100

Author: grothoff
Date: 2012-03-20 09:27:43 +0100 (Tue, 20 Mar 2012)
New Revision: 20626

Modified:
   gnunet-gtk/src/fs/gnunet-fs-gtk_publish-dialog.c
Log:
-LRN: use GNUNET_DISK_file_size to get size, fixing #2225

Modified: gnunet-gtk/src/fs/gnunet-fs-gtk_publish-dialog.c
===================================================================
--- gnunet-gtk/src/fs/gnunet-fs-gtk_publish-dialog.c    2012-03-20 06:55:18 UTC 
(rev 20625)
+++ gnunet-gtk/src/fs/gnunet-fs-gtk_publish-dialog.c    2012-03-20 08:27:43 UTC 
(rev 20626)
@@ -1012,6 +1012,7 @@
   GtkTreeRowReference *row_reference;
   GtkTreePath *path;
   struct stat sbuf;
+  uint64_t fsize;
   
   if (0 != stat (item->filename,
                 &sbuf))
@@ -1019,6 +1020,10 @@
     GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, "stat", item->filename);
     return;
   }
+
+  if ((item->is_directory != GNUNET_YES) && (GNUNET_OK !=
+      GNUNET_DISK_file_size (item->filename, &fsize, GNUNET_YES, GNUNET_YES)))
+    return;
   gtk_tree_store_insert_after (ts, item_iter, parent, sibling);
   path = gtk_tree_model_get_path (GTK_TREE_MODEL (ts), item_iter);
   row_reference = gtk_tree_row_reference_new (GTK_TREE_MODEL (ts), path);
@@ -1050,7 +1055,7 @@
                                                      item->meta, 
                                                      
adcc->directory_scan_do_index,
                                                      &adcc->directory_scan_bo);
-    file_size_fancy = GNUNET_STRINGS_byte_size_fancy (sbuf.st_size);
+    file_size_fancy = GNUNET_STRINGS_byte_size_fancy (fsize);
   }
   gtk_tree_store_set (ts, item_iter, 
                      0, file_size_fancy,




reply via email to

[Prev in Thread] Current Thread [Next in Thread]