Directory size in properties doesn't count hidden files

Bug #730142 reported by jahvascriptmaniac
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Nautilus
Unknown
Unknown
nautilus (Ubuntu)
Triaged
Low
Unassigned

Bug Description

Binary package hint: nautilus

What happens :
When doing right-click → Properties on a directory's icon, the «Contents» field reports an incorrect file size : hidden files are not take into account.

This happens even if hidden files are displayed.

This happens both as root and as non-root.

What should happen :
Hidden files should be included in directory size calculation. If for some bizarre reason you estimate that they shouldn't be taken into account (this violates the principle of least astonishment, but nevermind), at least they should be taken into accound when hidden files are shown.

Steps to reproduce :
cd /tmp
mkdir -p a/.hidden
dd if=/dev/urandom of=a/dataOk bs=1M count=5
dd if=/dev/urandom of=a/.hidden/dataIgnored bs=1M count=10
dd if=/dev/urandom of=a/.dataHiddenIgnored bs=1M count=10
du -hs a
# du reports 26M.
nautilus .
# right-click on a → properties reports 5M.

lsb_release -rd :
Description: Ubuntu 10.04.2 LTS
Release: 10.04

apt-cache policy nautilus :
nautilus:
Installed : 1:2.30.1-0ubuntu1.1
Candidate : 1:2.30.1-0ubuntu1.1
Version table :
*** 1:2.30.1-0ubuntu1.1 0
500 http://fr.archive.ubuntu.com/ubuntu lucid-updates/main Packages
100 /var/lib/dpkg/status
1:2.30.0-0ubuntu4 0
500 http://fr.archive.ubuntu.com/ubuntu/ lucid/main Packages

Revision history for this message
Andrew Hayzen (ahayzen) wrote :

Hi jahvascriptmaniac

Thank you for taking the time to report this bug and helping to make Ubuntu better.

I can confirm that when using the package nautilus on Ubuntu 10.10 using the steps provided by jahvascriptmaniac that I can reproduce the bug. Therefore I have set this bug to confirmed.

To reproduce this bug I followed the steps below:

1. Create a new folder called test in your home directory
2. Create (or copy) a file inside this folder and make it hidden.
3. Right-click on the folder and click properties
4. Note that properties window says 'Contents: nothing'
5. Press CTRL+H to show hidden files
6. Go back to properties window and note that it still says 'Contents: nothing'

What I expected to happen:
For the Nautilus properties window to include the size of hidden files and number of hidden files either:
-All the time
or
-When hidden files are selected to be shown (CTRL+H)

However someone will need to decide which behaviour should be the default. I personally would expect the second option to be the default and not the current behaviour.

Description: Ubuntu 10.10
Release: 10.10

nautilus:
  Installed: 1:2.32.0-0ubuntu1.3
  Candidate: 1:2.32.0-0ubuntu1.3
  Version table:
 *** 1:2.32.0-0ubuntu1.3 0
        500 http://gb.archive.ubuntu.com/ubuntu/ maverick-updates/main i386 Packages
        100 /var/lib/dpkg/status
     1:2.32.0-0ubuntu1 0
        500 http://gb.archive.ubuntu.com/ubuntu/ maverick/main i386 Packages

Andy

Changed in nautilus (Ubuntu):
status: New → Confirmed
Revision history for this message
jahvascriptmaniac (jahvascriptmaniac) wrote :

Hello,

> I personally would expect the second option to be the default and not the current behaviour.

Actually, I think the first option (always count hidden files) should be the default.

If that wasn't the case, one might have some space used by hidden files and wouldn't have even a hint that something is hidden somewhere. Also, when copying a folder, say, to a USB pen drive, those hidden files are copied, even if hidden files aren't displayed. So somebody using right-click → properties to calculate how much stuff he/she could put on the drive would be mislead.

Also, it is the default in every other file manager I have ever seen (and I have used a lot, from Thunar to MSExplore), so the principle of least astonishment should apply here.

What I have seen in some file managers, and IMO it's the best option, is the following display (I think this is the way Thunar does it, but I can't remember for sure) :

Content : 1234 files (2Gb), including 178 hidden elements (15Mb).

That way, there's no ambiguity, the user knows the exact weight of the folder, and has a hint that he/she can't se a portion of it. And it really keeps things simple (nothing is hidden to the user, no «bad surprises»).

Goodbye,
jahvascriptmaniac

Revision history for this message
Andrew Hayzen (ahayzen) wrote :

Hi jahvascriptmaniac

I did say that this was my personal opinion and it is up to the developers of nautilus how to fix this bug.

However after seeing the solution
'Content : 1234 files (2Gb), including 178 hidden elements (15Mb).'
I feel that that would be the best way to present the size.

The reason that I originally felt that the size should only be shown after showing hidden items is because sometimes people will hide files for a reason so that people don't know that they are there. But when they look at the size of the folder and find that it doesn't match up with the files in it then they would then work out that there are hidden files there.

Overall however I feel that the default solution should be:
'Content : 1234 files (2Gb), including 178 hidden elements (15Mb).'
But as I said above it is down to the developers (or a person higher up) to decide, not me.

Hope that clears up any issues.

Andy

Changed in nautilus (Ubuntu):
importance: Undecided → Low
Revision history for this message
Robert Roth (evfool) wrote :

Thank you for your bug report. This bug has been reported to the developers of the software. You can track it and make comments at: https://bugzilla.gnome.org/show_bug.cgi?id=329879

Changed in nautilus (Ubuntu):
status: Confirmed → Triaged
Revision history for this message
Robert Roth (evfool) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. This particular bug has already been reported and is a duplicate of bug #33883, so it is being marked as such. Please look at the other bug report to see if there is any missing information that you can provide, or to see if there is a workaround for the bug. Additionally, any further discussion regarding the bug should occur in the other report. Feel free to continue to report any other bugs you may find.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.