• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: /usr/share/zoneinfo file formats
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: /usr/share/zoneinfo file formats


  • Subject: Re: /usr/share/zoneinfo file formats
  • From: Chris Kane <email@hidden>
  • Date: Tue, 31 Dec 2002 19:56:12 -0800

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@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >/usr/share/zoneinfo file formats (From: Todd Blanchard <email@hidden>)

  • Prev by Date: Quit Application doesn't send window close methods
  • Next by Date: Re: Async. Notifications in a multi-threaded application
  • Previous by thread: /usr/share/zoneinfo file formats
  • Next by thread: Getting row and column information from an NSTextView
  • Index(es):
    • Date
    • Thread