erlug
[Top] [All Lists]

Re: [Erlug] maildir

To: Erlug <erlug@xxxxxxxxxxxxxx>
Subject: Re: [Erlug] maildir
From: Davide Alberani <alberanid@xxxxxxxxx>
Date: Fri, 25 Oct 2002 11:01:43 +0200
On Oct 24, Federico Detassis - <fdtas@xxxxxx> wrote:

> Da quanto ho potuto vedere la miglior mailbox e' maildir.

Personalmente apprezzo il formato Maildir, ma ha anche i suoi
svantaggi, tra i quali lo spazio perso su disco.

Piccolo orrendo script per calcolare quanto spazio ti mangi:

#!/usr/bin/env python2.2

import sys, os, statvfs

if len(sys.argv) != 2 or not os.path.isdir(sys.argv[1]):
    print "L'unita` Evangelion 02 si accanira` contro di te..."
    sys.exit(10)

os.chdir(sys.argv[1])
bsize = os.statvfs('.')[statvfs.F_FRSIZE]

def pretty_size(bytes):
    if bytes / 1048576:
        return '%s MBytes' % str(round(float(bytes) / 1048576, 2))
    if bytes / 1024:
        return '%s KBytes' % str(round(float(bytes) / 1024, 2))
    return '%d Bytes' % bytes

def lost_space(dir):
    totlost = 0L
    for f in os.listdir(dir):
        fname = os.path.join(dir, f)
        if os.path.isdir(fname):
            totlost += lost_space(fname)
        if os.path.isfile(fname):
            fsize = os.stat(fname)[os.path.stat.ST_SIZE]
            totlost += bsize - ((fsize % bsize) or bsize)
    return totlost
        
print 'Ti sei perso per strada %s.' % pretty_size(lost_space('.'))

sys.exit(0)

> Di altri non so.
> qualcuno sa dirmi niente in proposito ?

Il mail reader di mozilla lo supporta.

-- 
(=---= alberanid@xxxxxxxxx =------------= PGP KeyID: 0x465BFD47 =---=)
 )                         Davide Alberani                          (
(=-= http://digilander.libero.it/alberanid/ =-= ICQ UIN: 83641305 =-=)

<Prev in Thread] Current Thread [Next in Thread>