Trash spec: directory size cache

David Faure faure at kde.org
Wed Apr 17 01:12:22 PDT 2013


On Tuesday 16 April 2013 09:03:22 Alexander Larsson wrote:
> On tis, 2013-04-16 at 00:15 +0200, Ryan Lortie wrote:
> > hi David,
> > 
> > On 2013-04-15 18:47, David Faure wrote:
> > > 16950 15803468 Documents
> > > 2467 15803582 Another_Folder
> > 
> > One thing I forgot to ask for a clarification on earlier, and certainly
> > something that we should spell out in the spec: what do we mean by
> > 'size'?  Sum of byte-sizes of all files, or 'disk space used' sizes of
> > all files and directories?
> > 
> > I guess the second one makes more sense, but the sizes you show here
> > don't seem to be multiples of disk block sizes, which is usually the
> > case for this type of sizes.
> > 
> > Your thoughts?
> 
> Sum of block sizes isn't a perfect measurement either. For one it
> doesn't count the disk space of the directories themseleves, nor does it
> handle things like tailpacking, hardlinks, etc.
> 
> However, it is more reliable than just the sum of the sizes (i.e. it
> handles sparse files and many-small-files better), and its tractable to
> compute, so I'd say go with it.

OK. Thanks everyone for the input.
I have combined it all into the attached patch for the trash specification.

Note that I largely rewrote the non-normative algorithm compared to the 
initial email; please check.

If you find html-in-a-patch hard to read, you can look for "Directory size 
cache" at this page: http://www.davidfaure.fr/2013/trashspec_proposal.html

-- 
David Faure, faure at kde.org, http://www.davidfaure.fr
Working on KDE, in particular KDE Frameworks 5
-------------- next part --------------
A non-text attachment was scrubbed...
Name: trashspec_directorysizes.diff
Type: text/x-patch
Size: 6367 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/xdg/attachments/20130417/a1fbc143/attachment.bin>


More information about the xdg mailing list