GNOME Bugzilla – Bug 62713
Can't get to the exact file size
Last modified: 2006-01-28 15:08:04 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)).
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).
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.
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.)
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.
*** Bug 69652 has been marked as a duplicate of this bug. ***
*** Bug 108541 has been marked as a duplicate of this bug. ***
Adding GNOMEVER2.3 keyword
*** Bug 72845 has been marked as a duplicate of this bug. ***
*** Bug 126879 has been marked as a duplicate of this bug. ***
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?
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
Gautier?
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.
You seem to miss the fm-properties-window.c part of the patch, don't you?
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>