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

Re: [coldsync-hackers] Setting time



Helge Oldach:
> Andrew Arensburger:
> > On Wed, 2 Jan 2002, Helge Oldach wrote:
> > > The script fails because there are no handlers defined for creator
> > > "psys" and type "sprf".
> > >
> > > I don't see how I can call something similar to
> > >
> > > 	&Palm::PDB::RegisterPDBHandlers("Palm::PDB",
> > > 		[ "psys", "sprf" ],
> > > 		);
> > 
> > 	The easiest way is just to
> > 
> > 	use Palm::Raw;
> > 
> > which registers itself as a handler for any and all databases unless
> > there's something better.

It often helps to re-consider the problem the next day...

The issue is that "Saved Preferences.prc" is not a PDB database
but a PRC database. Hence we need to RegisterPRCHandlers and not
RegisterPDBHandlers.

To summarize for the list: To synchronize time on the Palm add to
~/.coldsyncrc:

	conduit sync {
		path: "/where/ever/it/is/located/SetSysDateTime.pl";
		type: psys/sprf;
	}

while the script's contents is:

	#!/usr/bin/perl

	use strict;
	use ColdSync;
	use ColdSync::SPC;
	use Palm::Raw;

	&Palm::PDB::RegisterPRCHandlers("Palm::Raw", [ "psys", "sprf"] );

	StartConduit("sync");

	@_ = localtime(time);
	$_[5] += 1900;	# year correction
	++$_[4];	# month 0..11 -> 1..12
	&dlp_SetSysDateTime(reverse @_[0..5]) && die "501 Cannot SetSysDateTime";

	EndConduit();

That's it. Perhaps it's worthwhile adding this to the ColdSync
distribution.

Thank you all for sharing.

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