discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: New -base release?


From: Richard Frith-Macdonald
Subject: Re: New -base release?
Date: Tue, 16 Aug 2011 08:57:28 +0100

On 16 Aug 2011, at 08:32, Riccardo Mottola wrote:

> Hi
>> 
>> *light bulb on* ! Perhaps we do not read the conent, but we assume it is a 
>> symlink? I tried switching versions using a symlink and not by copying 
>> again.... I need to test that too. Darn. 
> I confirm this.
> 
> It is not a matter if "localtime" is of version 1 or 2: if it is a raw copy, 
> it doesn't work, if it is a symlink, it works. We interpret the "path" and 
> not the contents (makes sens, i couldn't find provision in NSTimeZone for 
> interpreting the contents of a binary file).
> 
> It is perfectly licit however that localtime is a copy and not a simlink.
> 
> Perhaps david can shed more light on how to interpret the TZ on freebsd.
> 
> There exists tzname, but it is only an abbreviation. The tm structure 
> contains:
> 
>            int tm_isdst;   /* is summer time in effect? */
>            char *tm_zone;  /* abbreviation of timezone name */
> 
> But I understand we want "Europe/Rome" and not "CE" + the ST bit.  Otherwise 
> we can't distinguish Europe/Berlin from Europe/Rome... both are CE.
> 
> "Use of the external variable tzname is discouraged; the tm_zone entry in the 
> tm structure is preferred." But that doesn't help us either.

Yes, we want the timezone *name* ... ('Europe/Rome' in your case).

Using the contents of a symlink (rather than the timezone data file) is one way 
to get the name (where there's no API to use or environment variable/file to 
read to get the name).
 
If the file has been copied, we could in theory examine the file, and compare 
it with all the installed timezone files on the system to find which timezone 
it actually is, and get the timezone name from the name of the original file 
... but that would be very slow.  Probably we could speed things up by 
developing heuristics to guess the most likely file from other information (so 
we can find the correct file without having to examine so many) and could speed 
things up for later executions by storing the file name in the defaults system 
so we could check it first ... all that would be more complex code to maintain 
though.  What we really want is a fairly efficient/simple way of getting the 
zone name.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]