On 28 March 2017 at 13:00, Martin <rinfo@avisoft.f9.co.uk> wrote:
In article <5623de7e4dwebpages@sprow.co.uk >,
Sprow <webpages@sprow.co.uk> wrote:
> In article <5623d81c25rinfo@avisoft.f9.co.uk >,
> Martin <rinfo@avisoft.f9.co.uk> wrote:
> > In article <20170326163138.GA22998@spod.org >,
> > Peter Howkins <rpcemu.howkins@marutan.net> wrote:
> > > Can you get Marin Avison to describe the issue as he sees it?
> >
> > I have sent Peter as much detailed information as I can, but I will
> > summarise the problem here as I see it.
> >
> > The times are not the same as shown on 'real' RISC OS machines, or on
> > VRPC with HostFS 2009 or later.
> Extra pertinent information would be what underlying FS the HostFS
> files are held on? NTFS stores times in UTC, FAT stores times in local
> time,
Sorry - should have included that. The OP uses NTFS.
I've found the underlying cause of the problem, and it's a "feature" of Windows:
On Windows, stat() doesn't return UTC, it returns local time, for ancient compatibility reasons. Essentially they gave NTFS the behaviour of FAT, even though NTFS is storing UTC timestamps. For some reason they chose to do this for programs using the POSIX-like stat().
On Windows, stat() doesn't return UTC, it returns local time, for ancient compatibility reasons. Essentially they gave NTFS the behaviour of FAT, even though NTFS is storing UTC timestamps. For some reason they chose to do this for programs using the POSIX-like stat().
The recommended solution is to use the Win32 API to read the file times instead.
More detail at:
https://www.codeproject.com/Articles/1144/Beating-the-Daylight-Savings-Time-bug-and-getting
https://support.microsoft.com/en-gb/help/158588/obtaining-universal-coordinated-time-utc-from-ntfs-files
https://www.codeproject.com/Articles/1144/Beating-the-Daylight-Savings-Time-bug-and-getting
https://support.microsoft.com/en-gb/help/158588/obtaining-universal-coordinated-time-utc-from-ntfs-files
I'll work on a fix, and make sure it's available in a released version before we change the clocks again.
Matthew
No comments:
Post a Comment