Ticket #53 (closed defect: invalid)

Opened 4 years ago

Last modified 4 years ago

File sizes are in blocks and not in bytes

Reported by: bruno.mattarollo@rsp.com.au Assigned to: mlandauer
Priority: blocker Milestone: milestone1
Component: Daemon Version:
Keywords: Cc:

Description

I am not 100% sure about this but I suspect that the "size" from stat returns the size in blocks and not the size in bytes. On my Mac, there's a clear difference between issuing a "du -h" on a directory that's being watched by the daemon and the size reported in through the data collected by the daemon.

Change History

12/13/06 23:30:37 changed by bruno.mattarollo@rsp.com.au

As an example. I am watching a directory ~/Development/Alfresco/

From the daemon:

magpie.rsp.com.au /Users/bruno/Development/Alfresco 145.6 MB

From "du -hs ."

~/Development/Alfresco bruno$ du -hs . 335M

12/13/06 23:31:39 changed by bruno.mattarollo@rsp.com.au

Sorry ... one more thing:

magpie:~/Development/Alfresco bruno$ df -l Filesystem 512-blocks Used Avail Capacity Mounted on /dev/disk0s2 390050144 171816192 217721952 44% /

512-blocks is the default on HFS+ (my filesystem) which seems to be consistent with the difference in size, approx.

12/14/06 10:40:14 changed by bruno.mattarollo@rsp.com.au

OK, from the Ruby documentation, File.size returns the size (I assume in blocks) and File::Stat.size returns it in bytes. We should be using the second one. :-)

12/14/06 11:04:44 changed by bruno.mattarollo@rsp.com.au

  • status changed from new to closed.
  • resolution set to invalid.

Duh! Ignore this. When you run File.lstat.size, it's actually running File::Stat.size so ... that's not a problem. The difference is because the daemon is not looking into hidden directories (like .svn in this particular case).

I think we should read hidden directories as they contribute to the space consumption. I will create another ticket with that enhancement request.