[Tutor] Too many open files -- how to copy a folder?

Matej Cepl cepl at surfbest.net
Fri Oct 29 00:55:59 CEST 2004


Hi,

I've tried this:

blahoslav:matej$ python
Python 2.3.4 (#2, Sep 24 2004, 08:39:09)
[GCC 3.3.4 (Debian 1:3.3.4-12)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import mailbox
>>> box = mailbox.Maildir("/home/matej/WP/trash/")
>>> another = [x for x in box]
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/lib/python2.3/mailbox.py", line 246, in next
IOError: [Errno 24] Too many open files:
'/home/matej/WP/trash/cur/1098844013.6284.XKuCF:2,S'

Can be done something about that? Of course, that I will use some filter in
the mapping, but still even when I try

>>> import email,email.Utils
>>> import mailbox
>>> box = mailbox.Maildir("/home/matej/WP/trash/")
>>> date = email.Utils.parsedate_tz
>>> import time
>>> dlist = list(time.localtime())
>>> dlist[1] -= 3
>>> archdate = tuple(dlist)
>>> alist = [x for x in box if date(x['date'])<archdate]
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/lib/python2.3/mailbox.py", line 246, in next
IOError: [Errno 24] Too many open files:
'/home/matej/WP/trash/cur/1098844013.6284.XKuCF:2,S'
>>>

I don't get too far (and the folder is not that extreme -- 1333 messages).
Any thoughts?

Matej


-- 
Matej Cepl, http://www.ceplovi.cz/matej
GPG Finger: 89EF 4BC6 288A BF43 1BAB  25C3 E09F EF25 D964 84AC
138 Highland Ave. #10, Somerville, Ma 02143, (617) 623-1488
 
I have never killed a man, but I have read many obituaries with
great pleasure.
      -- Clarence Darrow





More information about the Tutor mailing list