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

Re: [coldsync-hackers] Newbie question: p5-palm and Yahoo AddressBook



On Mon, 16 Oct 2000, Per Reedtz Thomsen wrote:
> I am doing experiments that will lead to a conduit to the Yahoo
> addressbook, and I'm having trouble.

: $yab = new Palm::Address();
: print "Creator: ", $yab->{creator}, "\n";
: print "Type: ", $yab->{type}, "\n";
: 
: $yab->Load("/usr/home/pthomsen/ysync/Address/Yahoo_ab-n.aba");
: 
: exit 0;

> When I run it, I get the following result:
> 
> newton:~/ysync/Address [58] load-yab.pl
> Creator: addr
> Type: DATA
> No handler defined for creator "addr", type "DATA"
> newton:~/ysync/Address [59]

	That's because you have:

: use Palm::Address();
                   ^^
: use Palm::PDB;
: use Palm::Raw;
: use Palm::StdAppInfo;

	The parens after "use Palm::Address" mean "don't run
&Palm::Address::import();". That function registers Palm::Address as
the handler for record databases with creator "addr" and type "DATA".
	When you call $yab->Load(), it reads the creator and type from
the file, and looks in a table for a Perl class that'll handle that
database. Since you haven't added Palm::Address to the table, it can't
find anything.
	The fix is to take out the four "use" statements above, and
just use

	use Palm::Address;

> So far it seems that the file from Yahoo is fraught with problems. There
> are are no readable 'creator' and 'type' fields in the file (I edited
> the file to contain 'addr' and 'DATA'), and the attributes (from PDB.pm)
> field seems to indicate that the file is a resource and not a database.

	Hm. Sounds as if it's not a Palm database. Does 'pdbdump
Yahoo_ab-n.aba' give any meaningful results?

> After short circuiting PDB.pm (assigning the
> $self->{attributes}{resource} to 0), the file can be read, but there are
> complaints about the offset of the records:
> 
> Record 28 has same offset as previous one: 16778496
> Record 30 has same offset as previous one: 83887360
> Record 31 has same offset as previous one: 83887360
> Record 37 has same offset as previous one: 0

	These messages are complaints about zero-length records. I'm
not sure yet whether these are a Bad Thing in the general case.
	Here, though, it appears that they are definitely not good. In
particular, these offsets are far too high to be reasonable (I can't
imagine that you'd have an 83Mb address book), and the fact that the
last "same offset" is lower than the previous one is particularly
suspicious. Again, are you sure this is a Palm database file?

-- 
Andrew Arensburger                      This message *does* represent the
arensb@ooblick.com			views of ooblick.com
     An idea is not responsible for the people who believe in it.


-- 

--
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.