Skip navigation.
 
mlRe: /usr/share/zoneinfo file formats
FROM : Chris Kane
DATE : Wed Jan 01 04:56:12 2003

On Wednesday, December 18, 2002, at 01:14 PM, Todd Blanchard wrote:

> I have a library that purports to be able to read timezone info from
> any "standard" unix systems zoneinfo database.
>
> It sez:
> --------
> "Time zone rules are loaded by reading compiled tzfile files from an
> external source. Compiled tzfiles files are commonly distributed with
> Unix and Linux systems.
>
> A compiled tzfile is typically generated by the zic(1) compiler
> distributed
> as part of the public domain timezone database in the ~ftp/pub directory
> of elsie.nci.nih.gov FTP server. Source code, documentation, and the
> full (human readable) rule file source is available from
> elsie.nci.nih.gov.
> The tzfile data must be obtained separately. If you have a Unix-like
> system, look in /usr/share/zoneinfo."
> ---------


'elsie' is where the data for the files in /usr/share/zoneinfo comes
from...


> I find a bunch of promising looking files in /usr/share/zoneinfo.  but
> looking at the code, it tries to validate the files are of the correct
> format by checking for the magic string 'TZif' in the first 4 bytes of
> the file.  This fails.
>
> The first couple dozen bytes of each of these files on my Mac are all
> zero.  So does anybody know what format these files are in and why
> they're different from other unixen?


The format is given in /usr/include/tzfile.h.  These are basically just
compiled from the data files at elsie using the zic tool in the
distribution.  I don't see an option for zic to include or not a magic
number.  Historically, I don't remember ever seeing a 'TZif' magic
number on the zone info files.  The data patterns in /etc/magic, which
describe to the 'file' command how to recognize different types of file
data, also does not specify any magic numbers for 'timezone data'.  A
'TZif' magic number may be a relatively recent development.


Chris Kane
Cocoa Frameworks, Apple
_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

Related mailsAuthorDate
ml/usr/share/zoneinfo file formats Todd Blanchard Dec 18, 22:14
mlRe: /usr/share/zoneinfo file formats Chris Kane Jan 1, 04:56