[an error occurred while processing this directive] Node:Zoneinfo, Next:, Previous:Dual DOS/Windows, Up:Miscellany

22.20 What is in that zoneinfo directory?

Q: When I installed DJGPP v2, it created a directory named zoneinfo with a lot of small files that take up 3.5MB of my disk space. What are they for? Can I delete them?

A: These files exist so that time-related library functions can correctly calculate the offset between the local time and the UTC (Coordinated Universal Time). This offset is required when you get files from another time-zone, like from the Internet, or when you download an archive that was compressed in another time-zone.

One case where the time stamps might be very important is when you need to rebuild some package with Make. Make uses file time stamps to decide which files need to be rebuilt. Another case is if you distribute some files compressed with Zip and want your recipients to be able to restore the correct time stamps of your files when they unzip them.

If you don't care about file time stamps being incorrect in such cases, you can delete all those files and never look back.

You might wonder why we need all these zoneinfo files when the UTC offset is required. Well, the simplest way to tell programs what the UTC offset is, is to have the user specify a single number which is the offset; but then this number needs to be changed twice a year, to accommodate for the daylight saving time. Another, not-quite-so-simple way is to have the user specify the current UTC offset and the DST rules; but this is a tedious and error-prone process, and many users get it wrong. Both of these methods have the drawback that if the rules change, programs misinterpret old time-stamps, since they treat them according to new rules. Using a table that is read from a file and includes the offset calculation rules for every year avoids all these problems and requires the user to point the TZ environment variable to the file that is pertinent to his/her time zone, which is easy:

 set TZ=c:/djgpp/zoneinfo/israel

or

 set TZ=c:/djgpp/zoneinfo/us/alaska

To find the rule suitable for your location, look into the src subdirectory of zoneinfo and browse the file whose name is your continent/part of the world. If no binary file exists with the name of your zone, you can create one with using the time-zone compiler zic which comes with the v2/djtzn203.zip file (it unzips into the etc subdirectory of the main DJGPP installation directory).

A public domain time-zone database exists, and is updated from time to time with the latest world-wide changes to the offset calculation rules. (The rules change because politicians in different countries make laws that change the local clock settings.) The contents of the zoneinfo directory which comes with DJGPP is based on this database, but if you want the latest rules, you can download them from the net as tzdata*.tar.gz; tzcode*.tar.gz in the same directory includes the programs that can be used to generate the offset tables from their source in tzdata*.tar.gz, the latest implementations of POSIX library functions that use time-zone information, and the manual pages that document the rules and the software. The last update as of this writing was in September 1999.

On any single machine, you don't need more than a single file from that directory, which is the file for your time zone; once you find that file, you can safely delete the rest. But if you distribute a program that uses the TZ setting, you will have to include all of the files, or tell your users how to get and install them.


[an error occurred while processing this directive]