[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [coldsync-hackers] How to delete all records from one DB every every sync time sync happens?



>         If you really want to delete everything, you'll need to write
> a Sync conduit to do so. The DLP DeleteRecord call takes a special
> argument value to mean "delete all records," so this should be a
> fairly short script. Unfortunately SPC.pm doesn't have the
> DeleteRecord function yet.

I tried to delete DB using dlp_req but no succes.
Sample code is below.
This conduit runs only for my creator/type.
DB should be closed before deleting, so it is closed because I'm not even opening
it.
$retval contains nothing, and $err contains 0x35.
So there was an error deleting DB, but i don't know why.
DB do contains dirty records.

BTW
Why does dlpdeleterecord in dlp_cmd.c uses uid to find record? It takes O(n) for
finding it.
What is the "special argument value" for dlpdeleterecord to mean "delete all
records"?

Wojtek

CODE:
#!/usr/bin/perl
use ColdSync;
use ColdSync::SPC;
use Palm::Zamw;

StartConduit("sync");

my $retval;
$base="dokumen";
($err,@odp)=&dlp_req(0x1a,{ id=>0x20, data=>pack("C a*x",0,$base)});

  for (@odp)
       {
       if ($_->{id} == 0x20)
               {
               $retval=unpack("C",$_->{data});
               }
       else { }
       }
open OUTFILE,">logfile";

print OUTFILE ($retval,"\n");
print OUTFILE ($err,"\n";

close OUTFILE;
EndConduit();



-- 
This message was sent through the coldsync-hackers mailing list.  To remove
yourself from this mailing list, send a message to majordomo@thedotin.net
with the words "unsubscribe coldsync-hackers" in the message body.  For more
information on Coldsync, send mail to coldsync-hackers-owner@thedotin.net.