Paul Eggert <eggert@cs.ucla.edu> wrote on Fri, 10 Feb 2017 at 00:18:22 -0800 in <2c1949bd-fed5-a848-900b-4ac45b6deada@cs.ucla.edu>:
On GNU/Linux a common tool for that is the 'file' command. For example, on Fedora 25:
I'm not quite sure what you're getting at, because I feel like I could replace the word 'file' with 'ls -l' and have your message convey the same information... :) Maybe -ld tho. But yes, if we went with a prefixed string of '@(#)' and recorded the original zone name in the file, it would be nice to have file(1) display it as well; this is compatible with having the string displayed by what(1), so would be great to do both. I am not a magic(5) expert, but I believe the "search" operator lets that happen (and it would only be invoked on files matching the existing 'TZif' magic string, see magic/Magdir/timezone in the file source distribution). In the other part of my thread, I fear Brian Inglis misunderstood my intent. It was not to suggest that what(1) ought to be the only mechanism to display this information (thus launching debates about how many people have the tool installed, or whether it is obscure, etc., etc.); it is instead to suggest adopting a mechanism compatible with it, so that it works for many people today. That doesn't preclude a tz-specific tool (perhaps part of file(1) or standalone tool). --jhawk@mit.edu John Hawkinson
$ file /usr/share/zoneinfo/America/Los_Angeles /usr/share/zoneinfo/America/Los_Angeles: timezone data, version 2, 5 gmt time flags, 5 std time flags, no leap seconds, 186 transition times, 5 abbreviation chars
Here the string "America/Los_Angeles" is already part of the output. Presumably the intended application for a change to the binary file format is when the binary file has been renamed or linked and someone wants to know the "originally-intended" or "canonical" name. tz follows the Unix tradition where files do not have canonical names - a design flaw to some, and a design feature to others.
$ ls -l /usr/share/zoneinfo/America/Los_Angeles -rw-r--r-- 1 root root 2819 Dec 7 05:59 /usr/share/zoneinfo/America/Los_Angeles Here the string "America/Los_Angeles" is already part of the output. Presumably the intended application for a change to the binary file format is when the binary file has been renamed or linked and someone wants to know the "originally-intended" or "canonical" name. tz follows the Unix tradition where files do not have canonical names - a design flaw to some, and a design feature to others.