[Rpcemu] RPCEmu and Time

Matthew Howkins rpcemu-list at howkins.me.uk
Wed Mar 29 08:35:24 PDT 2017


On 28 March 2017 at 13:00, Martin <rinfo at avisoft.f9.co.uk> wrote:

> In article <5623de7e4dwebpages at sprow.co.uk>,
>    Sprow <webpages at sprow.co.uk> wrote:
> > In article <5623d81c25rinfo at avisoft.f9.co.uk>,
> >    Martin <rinfo at avisoft.f9.co.uk> wrote:
> > > In article <20170326163138.GA22998 at spod.org>,
> > >    Peter Howkins <rpcemu.howkins at 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().

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

I'll work on a fix, and make sure it's available in a released version
before we change the clocks again.

Matthew
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riscos.info/pipermail/rpcemu/attachments/20170329/19093d33/attachment.html>


More information about the Rpcemu mailing list