Home : Products : Gossamer Mail : Discussion :

Products: Gossamer Mail: Discussion: Re: [Alex] Ownership issues?: Edit Log

Here is the list of edits for this post
Re: [Alex] Ownership issues?
Hi Alex,

I am sort of trying to see the difference. consistency.pl --fix works but purge doesn't. If i am correct then Purge.pm is being used for purge operations. Though i do not understand much of perl etc... but where exactly in Purge.pm the data on disk is being referenced. It's all tables and tables (maybe my ignorance would prove me wrong) and that's why Purge is cleaning the tables.
Code:
sub msgs_purge {
# -------------------------------------------------------------------
# Purge a small number of messages.
#
my $url = $IN->param('purge_url');
$IN = GT::CGI->new($url);
my $cgi = $IN->get_hash;

delete $cgi->{msgtrack_id};
($cgi->{so} and ($cgi->{so} =~ /((?:asc)|(?:desc))/i)) ? ($cgi->{so} = $1) : ($cgi->{so} = 'asc');
$cgi->{sb} ||= 'msgs_sent';
$cgi->{mh} = -1;
my ($tb, $cond) = _build_query_cond($cgi) or return;
my $cnt = $tb->count($cond);
$cnt or return (FAILURE, { error => 'No messages to delete' });


$tb->delete($cond);

return(SUCCESS, { del_num => $cnt, message => "$cnt messages have been purged" });
}

consistency.pl does have the reference to disk

Code:
sub check_messages {
my ($path, $tb, $cnt, $fix) = @_;
opendir DIR, $path or die "Could not opendir $path; Reason: $!";
my @files = grep !/^\.\.?$/ => readdir DIR;
my $num_del = 0;
for (@files) {
print "\nWorking on $path/$_\n";
$num_del += _check_files("$path/$_", $tb, $fix);
}
print "\n$num_del messages were on disk and not in the database\n";
}

Even in msgs.pm (which i think is being used for "delete" or "Empty Folder" has a reference to disk. This could possibly explain why delete/empty folder/consistency.pl --fix all works fine. So in Purge where exactly is the reference to the disk like in consistency.pl where $path really eliminates the errors when run with --fix mode and in msgs.pm the disk is referenced so delete works.

Please ignore my ignorance, but logically i am trying to see where exactly the Purge operation is calling the disk or is it that Purge is all about clearing the database....

Help me understand thinking that yes i am a layman as far as pm/pl is concerned.

Thnx
Anup

Last edited by:

anup123: Jun 8, 2003, 6:34 AM

Edit Log: