default color: lavender w/red vlinks)
change to: default, lav, whi, gra, ora

Mail-Penguin::Main::Fetch: Get Next File Number
Mail-Penguin::Main::Fetch::Redirect::Send Message::Deliver by Disk:
Get Next File Number

last updated: Sunday, 24-Jan-1999 02:50:14 EST
[an error occurred while processing this directive]   visit to this page
[ write to Jeff ]

########################################################################
sub get_next_file_number {

    	    # 'shift' to obtain the pathname we sent
        
    my($path_to_index) = shift;

    	    # If 'index' doesn't exist, create it and
            # write a '0' and 9 spaces into it
            # (explained below)

    if (!-e "$path_to_index/index")
    {
        open (INDEX,">$path_to_index/index") or die "eek! -- index";
        if (defined INDEX)
        {
            print INDEX "0         ";
            close (INDEX) or die "eek! can't close Index(1)";
        }
    }

    	    # Open for reading.  We're looking for a 10-position
            # numeric with trailing spaces -- a format of index
            # numbering PowerWeb uses.  On my machine, PowerWeb's
            # POP server is what will finally deliver the mail
            # to my mail reader (and to other users' programs).
            # We'll read the number and increment it...

    open (INDEX,"<$path_to_index/index") or die "eek! -- index";
    if (defined INDEX)
    {
        while (<INDEX>)
        {
            /(\d+)\s/; # field is 10-chars wide, trailing-space padded
            $newcount = $1 + 1;
        }
        close (INDEX) or die "eek! can't close Index(2)";
    }

            # ...and then write it back into the index file
            # and 'return' it to the calling program code.

    open (INDEX,">$path_to_index/index") or die "eek! -- index";
    if (defined INDEX)
    {
        print INDEX sprintf("%-10s","$newcount");
        close (INDEX) or die "eek! can't close Index(3)";
    }
    return $newcount;
}

[ back to Fetch | back to Deliver by Disk | to sub queue_incoming ]