After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 62713 - Can't get to the exact file size
Can't get to the exact file size
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: general
2.13.x
Other All
: High enhancement
: 2.14.x
Assigned To: Nautilus Maintainers
Nautilus Maintainers
: 69652 72845 108541 126879 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2001-10-20 16:53 UTC by Ben Bucksch
Modified: 2006-01-28 15:08 UTC
See Also:
GNOME target: ---
GNOME version: 2.13/2.14


Attachments
proposed patch (2.92 KB, patch)
2005-04-13 01:24 UTC, Gautier Portet
none Details | Review
Updated patch (2.82 KB, patch)
2006-01-28 00:49 UTC, Justin Fitzsimmons
none Details | Review

Description Ben Bucksch 2001-10-20 16:53:38 UTC
I don't see *any* way in Nautilus to see the exact file size of a file.
Both View as List and even the File Properties show e.g. "12.6kB", not
"12.587 Bytes". I don't see a relevent preference either.

The exact file size is important e.g. to compare 2 files, if they are
identical (if you don't need to be absolutely sure (yet)).
Comment 1 Ben Bucksch 2001-10-21 02:34:18 UTC
Why enh/future?

IMO, it is a basic function of a file manager to retrieve detailed
meta-data about a file, like I can do with ls -al. Failing to give
that is IMO a severe bug (and renders the app almost useless for me).
Comment 2 Darin Adler 2001-10-21 04:56:14 UTC
OK. You've made that clear. You are the first one to mention this
particular missing feature. I agree that it's important. Many other
important enhancements are also marked "future".

Please don't feel that we are disrespecting your request. If you think
it's urgent that this be added, you might want to get some others to
make a similar complaint to make it clear how important this is.

We get 100s of complaints about other problems.

On the other hand, something that's easy to add like this is likely
to show up in a release soon. We add features all the time that are
marked "future".

The best way to get a feature added is to contribute an implementation
in the form of a patch.
Comment 3 Ben Bucksch 2001-10-21 05:08:12 UTC
Darin, thanks for the reponse. I just knew "Future" from Mozilla, and
there is basically means "Not in the next year" :-/.

> contribute an implementation in the form of a patch.

Any hints to a source-directory/file, in case I actually do want to
look at it?

(BTW: Thanks, Darin, for your continued work on Nautilus.)
Comment 4 Darin Adler 2001-10-21 17:50:03 UTC
The functions to look at are:

    create_basic_page in fm-properties-view.c
    nautilus_file_get_string_attribute in nautilus-file.c
    nautilus_file_get_size_as_string in nautilus-file.c

and if you are interested in the size in icon view:

    ICON_TEXT_ATTRIBUTES_DEFAULT_TOKENS in fm-icon-view.c
    icon_captions_enum_entries in nautilus-global-preferences.c

and if you are interested in the size in the list view:

    real_get_column_specification in fm-list-view.c
    real_get_column_specification in fm-search-list-view.c

It's not immediately obvious what the best design is. I like the way
the Macintosh Finder finesses this question. In list views, they
display amount of disk space used rather than file size. And
in the info window, they display both the amount of disk space used
and the file size, like this:

    Size: 12 KB on disk (6,457 bytes)

That file would show up as 12 KB in the list view. I think that's a
pretty nice design. Simply showing the size in both formats would not
be as good:

    Size: 6 KB (6,457 bytes)

and displaying only the size in bytes would be bad:

    Size: 15,456,418 bytes

I'd like to do what the Apple Finder does for the properties window,
and maybe we should do what they do for the size displayed in the
list view and the icon view as well and display the size used on
disk rather then the file size.

One issue is that gnome-vfs modules other than the "file:" module
might not fill in the block_count field of GnomeVFSInfo, which is what
we'd use to compute size used on disk, so we'd have to test
thoroughly and perhaps figure out how to handle this for files where
we have only the file size.

I also don't know of the number formatting function that we should
use to get the thousands separators right. I guess we can add one to
eel if we can't find one in the other libraries we use.
Comment 5 Darin Adler 2002-01-25 16:38:44 UTC
*** Bug 69652 has been marked as a duplicate of this bug. ***
Comment 6 Alex Duggan 2003-03-20 14:34:14 UTC
*** Bug 108541 has been marked as a duplicate of this bug. ***
Comment 7 Alex Duggan 2003-03-20 14:34:49 UTC
Adding GNOMEVER2.3 keyword
Comment 8 Glynn Foster 2003-04-23 13:43:05 UTC
*** Bug 72845 has been marked as a duplicate of this bug. ***
Comment 9 Matthew Gatto 2003-12-03 17:41:20 UTC
*** Bug 126879 has been marked as a duplicate of this bug. ***
Comment 10 Gautier Portet 2005-04-13 01:24:10 UTC
Created attachment 45195 [details] [review]
proposed patch

This patch show the real file size, only in the property window.

I looked for block_size as suggested, but the doc says it returns the number of
 512-byte blocks, but but that's not really the physical size of the file?

Any pointer to a function that will handle the thousands separators nicely?

And finally, do we also want to display the real file size in the status bar?
Comment 11 Christian Neumair 2005-07-10 17:16:52 UTC
Thanks for your efforts Gautier! Maybe you could send your patch to the nautilus
mailing list [1] for review, and ask the same questions you asked in comment 10.

[1] http://mail.gnome.org/mailman/listinfo/nautilus-list
Comment 12 Christian Neumair 2005-08-05 23:53:55 UTC
Gautier?
Comment 13 Christian Neumair 2005-10-04 11:17:32 UTC
Gautier?
Comment 14 Justin Fitzsimmons 2006-01-28 00:49:56 UTC
Created attachment 58247 [details] [review]
Updated patch

The previously supplied patch was good to go, and it still is.  I'm not sure why this patch was not applied and why this bug was not closed earlier.  The patch I am providing is against the latest CVS and contains a single fix to appease gcc4.  I will send a mail to the list in hopes of getting something done about this bug.
Comment 15 Jürg Billeter 2006-01-28 07:27:07 UTC
You seem to miss the fm-properties-window.c part of the patch, don't you?
Comment 16 Martin Wehner 2006-01-28 15:08:04 UTC
Thanks guys, I committed the original patch with a small modification on HEAD. The size field is long long so you have to use the proper format identifier instead of downcasting it to int. That'll bite you if you're dealing with huge files.

We *badly* need thousand separators now (which is the original reason for not including it sooner I guess), but that issue is tracked in bug 41455.

2006-01-28  Martin Wehner  <martin.wehner@gmail.com>

	* libnautilus-private/nautilus-file.c:
	(nautilus_file_get_size_as_string_with_real_size),
	(nautilus_file_get_string_attribute):
	* src/file-manager/fm-properties-window.c: (create_basic_page):
	Show the detailed file size in addition to the formatted one
	in the properties dialog. Fixes #62713.
	Patch from Gautier Portet <kassoulet@gmail.com>