Trash spec: caching the size of the trash directory

Matthew Paul Thomas mpt at canonical.com
Mon Aug 24 05:48:03 PDT 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Alexander Larsson wrote on 19/08/09 08:25:
> 
> On Thu, 2009-08-13 at 22:17 +0200, David Faure wrote:
>> 
>> And then it's up to implementations to update that value, when
>> adding a file to the trash, restoring a trashed file, deleting a
>> trashed file, and when emptying the trash.
>...
> I'm a bit concerned about the performance costs of this. It means that
> you need to do a deep recursion into a folder counting its size when
> it is trashed. Whereas otherwise trashing a large folder structure is
> O(1) it now becomed O(number of files) and does a lot more I/O.
>...

If you're considering it specifically for the Trash, the calculation and
disposal needn't be synchronous with the trashing action. It could
happen in the background.

(I'm not sure why you're considering it specifically for the trash,
though. Knowing the size of a folder quickly is useful for many folders,
for example when burning a CD or DVD, or when copying items to a memory
stick.)

- --
Matthew Paul Thomas
http://mpt.net.nz/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkqSi/8ACgkQ6PUxNfU6ecrBVACfaEB3J+V6R4q74lWnETmwni5e
Ij4AoNOoTqUMnyunPdnKCnKs5y0ZsUdd
=PcZp
-----END PGP SIGNATURE-----



More information about the xdg mailing list