MIME::Parser and Purge / Prune

Discussion in 'Perl Misc' started by afrinspray, May 31, 2006.

  1. afrinspray

    afrinspray Guest

    I'm using MIME Parser to parse emails for a listserv application.
    Everything works great except for the final cleanup stage. I end up
    with literally hundreds of directories (one per message) which aren't
    pruned upon completion. I could rm -rf them, but I'm guessing that I'm
    not telling MIME::parser to clean up correctly. Here's my code:

    $parser = new MIME::parser;
    $parser->output_under("/tmp");
    $parser->output_prefix("msg");
    $parser->decode_headers(0);
    $parser->extract_nested_messages(0);
    $parser->extract_uuencode(1);
    $parser->ignore_errors(1);

    [...parsing...]

    $parser->filer->purge;

    I end up with hordes of /tmp/msg- directories. Did I miss a step here?
    Does the output_under directive intentionally leave a copy there? I
    was under the impression that purge should remove the directories.


    Thanks,
    Mike
     
    afrinspray, May 31, 2006
    #1
    1. Advertising

  2. afrinspray

    afrinspray Guest

    Bump...

    afrinspray wrote:
    > I'm using MIME Parser to parse emails for a listserv application.
    > Everything works great except for the final cleanup stage. I end up
    > with literally hundreds of directories (one per message) which aren't
    > pruned upon completion. I could rm -rf them, but I'm guessing that I'm
    > not telling MIME::parser to clean up correctly. Here's my code:
    >
    > $parser = new MIME::parser;
    > $parser->output_under("/tmp");
    > $parser->output_prefix("msg");
    > $parser->decode_headers(0);
    > $parser->extract_nested_messages(0);
    > $parser->extract_uuencode(1);
    > $parser->ignore_errors(1);
    >
    > [...parsing...]
    >
    > $parser->filer->purge;
    >
    > I end up with hordes of /tmp/msg- directories. Did I miss a step here?
    > Does the output_under directive intentionally leave a copy there? I
    > was under the impression that purge should remove the directories.
    >
    >
    > Thanks,
    > Mike
     
    afrinspray, Jun 9, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rory Campbell-Lange

    newbie : prune os.walk

    Rory Campbell-Lange, Mar 10, 2005, in forum: Python
    Replies:
    4
    Views:
    492
    Tim Roberts
    Mar 12, 2005
  2. Girish Sahani
    Replies:
    3
    Views:
    296
    Bruno Desthuilliers
    Jun 29, 2006
  3. Jan Arickx
    Replies:
    0
    Views:
    216
    Jan Arickx
    Aug 25, 2003
  4. afrinspray
    Replies:
    0
    Views:
    120
    afrinspray
    May 9, 2006
  5. ecureuil
    Replies:
    0
    Views:
    356
    ecureuil
    May 28, 2006
Loading...

Share This Page