[MacPerl-Toolbox] Re: Timezone information

[email protected] (Chris Nandor) Tue, 6 May 2003 09:46:43 -0400
Newsgroups perl.macperl,perl.macperl.toolbox
Message-ID <p05200f03badd686e9883@[10.0.1.104]>
At 22:46 +1000 2003.05.06, Rick Measham wrote:
>Sorry Chris, I didn't explain myself too well. I'm looking for the name
>of the zone. It seems to be stored in the resource fork of 'Date & Time
>Preferences' (possibly ID256 of the 'pref' resources), but it's not in
>plain text. Maybe its an offset. Any ideas? Is it anywhere useful, or do
>I have to work out how this preferences file is encoded?

I don't see that data in the pref resources, any of them.  But it may work
for you.  Here's some code to get the resource data.

	#!perl
	use File::Spec::Functions;
	use Mac::Files;
	use Mac::Memory;
	use Mac::Resources;

	my $file = catfile(
	    FindFolder(kOnSystemDisk, kPreferencesFolderType),
	    'Date & Time Preferences'
	);

	my $rsfile = FSpOpenResFile($file, 0);
	my $rsrc   = GetResource('pref', 256);
	print $rsrc->get;

	CloseResFile($rsfile);


-- 
Chris Nandor                      [email protected]    http://pudge.net/
Open Source Development Network    [email protected]     http://osdn.com/