Re: Bug: sizes of big dirs

Hi, Radovan!

> The problem is (in TEXT-MODE mc):
> F9 - C - I      (F9 - Command - show directory sIzes)
> doesn't correctly show sizes for directories containing more
> than 2 GB of data.
> Insted of real size (something like "4824M") it shows number
> "2147488" for any dir > 2GB.

I confirm this bug.  I could reproduce it even if MC if compiled with
large files support (default for the CVS version).

Here's the fix:

--- cmd.c
+++ cmd.c
@@ -1420,7 +1420,7 @@ dirsizes_cmd (void)
 	         strcmp (panel->dir.list [i].fname, "..") != 0) {
 	    total = 0.0l;
 	    compute_dir_size (panel->dir.list [i].fname, &marked, &total);
-            panel->dir.list [i].buf.st_size = (long)total;
+	    panel->dir.list [i].buf.st_size = (off_t) total;
 	    panel->dir.list [i].f.dir_size_computed = 1;


It will only work if large file support is enabled, but it's now the
default (in CVS), and those disabling it must accept the consequences.

By the way, I think that using double instead of off_t in several places
is an overkill.  It should be sorted out later.  I think that double was
used as an alternative to adding 64-bit file support.  As it often
happened in the MC history, of all possible solutions the first one to
work (somehow) was used.

> Second bug, depending on the first one:
> When selecting directories, the bottom line of panel shows
> the sum of bytes. But these "2147488" dirs are summed as
> minus 2 GB,making the total smaller.

This works correctly with the current version.  I don't care how it works
if mc is configured with --disable-largefile

> And one more note: I hope You will not stop developing BOTH versions
> of mc (Gnome and text-mode). I know Linux is aiming to desktops, but
> it is also a great server with good remote administration, where mc
> takes a big, important role (probably the most important after
> telnet & telnetd, IMHO).

I must disappoint you.  I have never seen a single patch for the GNOME
frontend coming from users (i.e. not from Ximian employees).  People may
like it, but nobody in the whole world likes is so much to learn some
programming and improve it.

The GNOME frontend is only left in the stable branch, from which mc-4.5.56
may (or may not) be released.  The head branch leading to 4.6 already has
GNOME support removed.

I'm not going to improve anything in the GNOME frontend due to lack of
interest from users.  I'll only apply patches from others.

Pavel Roskin

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