On 2024-12-08 13:21, Guy Harris wrote:
(And, unfortunately, there's also no way to indicate "well, we*do* have a file for that tzid, but it's not a valid file" - e.g., tzh_timecnt specifies more transition times than are in the file - in a way that it can be distinguished from "we don't have a file for that tzid.)
Although POSIX provides no way to do that, tzcode does because tzalloc sets errno on failure and zdump uses strerror to tell the user. For example: $ zdump No/Such/Zone zdump: unknown timezone 'No/Such/Zone': No such file or directory $ zdump zone.tab zdump: unknown timezone 'zone.tab': Invalid argument $ zdump . zdump: unknown timezone '.': Is a directory (For extra credit, try 'zdump /etc/tty'. Maybe we should disallow that sort of thing....)