On 2017-10-15 00:13, Paul Eggert wrote:
Daniel Ford wrote:
Perhaps if I can find somewhere that explains 'POSIX TZ string format', I might begin to understand your table. I'll have a look around. http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html (Look for "TZ".) This explains the POSIX TZ variable's format. http://man7.org/linux/man-pages/man5/tzfile.5.html (Look for "Version 3 format".) This explains the minor extensions used in tzdb binary files.
The attached shell script will generate output similar to Paul's suggestion, when run against installed binary zoneinfo files. It was tested on Windows Subsystem for Linux/"Bash for Windows"/Ubuntu tzdata 2016j and Cygwin tzdata 2017b. The outputs from running the script against those systems are attached. Either or both systems can be installed under Windows to support Unix scripts and development, and both provide a tzdata package to install the zoneinfo files as part of their base systems. The script was simplified from a long one-liner pipeline using various commands, to do selection of files only using find, strings to extract text from each binary file, sed to pick the last line containing the POSIX rule, skip .../posix/..., .../right/..., *?.?* files, and strip the leading directory path to leave the zone paths. Storage space required could be reduced by filtering the list to only contain entries in zone1970.tab, front end compression of zone paths, and back end compression of common/duplicate rules. This could be done by a program to generate source code for compact C or asm tables to build into your system, using the zones and POSIX rules in the list, or the binary zoneinfo files directly, if you write a directory walker, strings finder, and filter to do the same as the script. -- Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada