[Top][All Lists]

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

[bug #12162] Enhancement req: finding files less than 2Gb in size

From: dan pritts
Subject: [bug #12162] Enhancement req: finding files less than 2Gb in size
Date: Tue, 10 Mar 2009 20:36:03 +0000
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en; rv: Gecko/20081212 Camino/1.6.6 (like Firefox/

Follow-up Comment #16, bug #12162 (project findutils):

I don't believe the behavior is correct, but here's the line of reasoning.

THe original find implementation counts disk blocks.  A block is either used
(partially or fully), or not.

Blocks are (typically?  always?) 512 bytes long.  

You are looking for blocks that are used, and therefore cannot be used by
other files, which is the key distinction why this makes sense for blocks but
not for megabytes or whatever. 

So if you search for size -2, you are not really searching for anything that
is using less than 1024 bytes, you are searching for something that is using 1
full block, and no portion of a second block.  

If you apply the same logic to a different unit, gigabytes, you will end up
with the situation where a file of 1 gigabyte + 1 byte is using a portion of
the second gigabyte, therefore the test fails.

This is obviously the wrong logic to use when units are something other than
disk blocks, but that's how it got this way.

The maintainer suggests in the comments below that changing this might break
backward compatibility.  Let's just say that I strongly disagree.  


Reply to this item at:


  Message sent via/by Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]