Do all processing in-core.

This commit is contained in:
hjp 2000-02-08 17:06:19 +00:00
parent 4f9255c36f
commit a71bee15a1
1 changed files with 2 additions and 2 deletions

View File

@ -39,8 +39,7 @@ sub dump_entity {
# Get MIME type, and display accordingly... # Get MIME type, and display accordingly...
my ($type, $subtype) = split('/', $entity->head->mime_type); my ($type, $subtype) = split('/', $entity->head->mime_type);
my $body = $entity->bodyhandle; my $body = $entity->bodyhandle;
my $path = $body->path; my $size = length($body->as_string);
my $size = ($path ? (-s $path) : '???');
print ' ' x $level, "Content-type: $type/$subtype ($size bytes)\n"; print ' ' x $level, "Content-type: $type/$subtype ($size bytes)\n";
} }
1; 1;
@ -59,6 +58,7 @@ sub main {
(-d ".mimedump-tmp") or mkdir ".mimedump-tmp",0700 or die "mkdir: $!"; (-d ".mimedump-tmp") or mkdir ".mimedump-tmp",0700 or die "mkdir: $!";
(-w ".mimedump-tmp") or die "can't write to directory"; (-w ".mimedump-tmp") or die "can't write to directory";
$parser->output_dir(".mimedump-tmp"); $parser->output_dir(".mimedump-tmp");
$parser->output_to_core(ALL);
# Read the MIME message: # Read the MIME message:
$entity = $parser->read(\*STDIN) or die "couldn't parse MIME stream"; $entity = $parser->read(\*STDIN) or die "couldn't parse MIME stream";