[hatari-devel] Wrong timestamp of copied files

Eero Tamminen oak at helsinkinet.fi
Thu Apr 14 22:24:02 CEST 2011


Hi,

On torstai 14 huhtikuu 2011, Laurent Sallafranque wrote:
> For me, thing works well (1.27 version with the public key).

Thanks, registration worked fine for English v1.27 I found here:
	http://transaction.perso.libertysurf.fr/pages/projects2.htm

(ST-Guide I loaded from same page crashes very easily though,
either when viewing ST-Guide or Thing hyp files.)


On lauantai 09 huhtikuu 2011, Uwe Seimet wrote:
> > I tried Thing 0.59 (that I happened to have around), on latest Debian
> > Stable (Linux 2.6.32), with latest Hatari from the repository.  At
> > least with that both Linux and Thing show the same, correct timestamps
> > after the copy.
> > 
> > Which OS, Hatari version and Thing version you're using?
> 
> It's with a German TOS 3.06 and Thing 1.29.

I tried English TOS and above Thing version.  Still works fine for me.


> I have more information now: The timestamp is one hour wrong for all
> copied files where the original file's timestamp has a date for which
> daylight saving time is/was active.

Wrong outside or inside Hatari?  Or both?

(For me timestamps correspond & are fine both inside & outside Hatari.)


> So the wrong timestamp appears for
> all files where the original file is newer than March, 27th, 2011. But
> also for files from some years ago, as long as the original timestamp
> lies within the daylight saving time range.
> 
> I'm quite sure that this can be reproduced with any version of TOS, as
> long as the files that are copied have a current timestamp.

What about your host OS?  I guess you use something else than Linux?

gemdos.c uses stat(), mktime() and localtime() functions:
* stat() gets file timestamps
* localtime() function converts them to a "struct *tm" value that takes DST
  into account /i.e. its "tm_isdst" member "should be" set) which is then
  converted to TOS time format
* TOS time is converted to "struct tm" and mktime() converts "struct *tm"
  back to a timestamp, taking "tm_isdst" into account

I noticed that "tm_isdst" isn't set explicitly in gemdos.c, could you test
whether the attached patch has any effect?


	- Eero

(It doesn't have effect on my machine, but I didn't have the problem either.
:))
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dst.diff
Type: text/x-patch
Size: 832 bytes
Desc: not available
URL: <https://lists.berlios.de/pipermail/hatari-devel/attachments/20110414/ccd18ae8/attachment.bin>


More information about the hatari-devel mailing list