Author Topic: Check your file managers...!  (Read 8603 times)

jj2007

  • Member
  • *****
  • Posts: 11760
  • Assembler is fun ;-)
    • MasmBasic
Check your file managers...!
« on: November 04, 2015, 05:27:22 AM »
Attached a version of \Masm32\include\ObjMem32.inc with a modified .inx extension to avoid any overwriting problems.

According to
- my default file manager, FreeCommander
- my previous one, 2x
- and 7-Zip, PeaZip, FreeArc

this file was last modified 24 May 2012, 01:00

Windows Explorer and Firefox say 24 May 2012, 02:00 8)

What do your goodies say?

nidud

  • Member
  • *****
  • Posts: 2304
    • https://github.com/nidud/asmc
Re: Check your file managers...!
« Reply #1 on: November 04, 2015, 05:53:39 AM »
File Property:
Code: [Select]
  ObjMem32.inx

  Local File Header
    Signature            04034B50
    Version needed       0014
    Bit flag             0000
    Compression method   0008
    Modification time    0800
    Modification date    40B8
File Panel:
Code: [Select]
24.05.2012   01:00:00

Code: [Select]
    Modification time 0800

    Binary: 0000100000000000
hhhhhmmmmmmsssss

jj2007

  • Member
  • *****
  • Posts: 11760
  • Assembler is fun ;-)
    • MasmBasic
Re: Check your file managers...!
« Reply #2 on: November 04, 2015, 06:00:30 AM »

File Panel:
Code: [Select]
24.05.2012   01:00:00

What is File Panel? Part of WinSCP?

Btw if I extract the file with 7-Zip to another folder, the result is identical: 01:00 in file managers, 02:00 in Explorer, and also in the file properties dialog, even if started per right-click from the "faulty" file manager. I have an explanation why this is so but would like to collect some evidence first.

ragdog

  • Member
  • ****
  • Posts: 610
Re: Check your file managers...!
« Reply #3 on: November 04, 2015, 06:13:54 AM »
Hello

Windows Explorer and Winrar say 24 May 2012, 02:00

dedndave

  • Member
  • *****
  • Posts: 8829
  • Still using Abacus 2.0
    • DednDave
Re: Check your file managers...!
« Reply #4 on: November 04, 2015, 06:16:55 AM »
i believe the file system stores the date and time in UTC
the information you see is then converted to the current local time settings

nidud

  • Member
  • *****
  • Posts: 2304
    • https://github.com/nidud/asmc
Re: Check your file managers...!
« Reply #5 on: November 04, 2015, 06:31:47 AM »
I do get surprised every now and then when the summer/winter time switch changes all the files by one hour. I usually set the time to version so that’s somewhat irritating.

jj2007

  • Member
  • *****
  • Posts: 11760
  • Assembler is fun ;-)
    • MasmBasic
Re: Check your file managers...!
« Reply #6 on: November 04, 2015, 06:50:01 AM »
i believe the file system stores the date and time in UTC
the information you see is then converted to the current local time settings

Yes indeed. The question is whether the Windows Explorer time is the same as the one reported by other tools. What does right-clicking in Explorer, File properties tell you?

Btw the creation date in attribute changer is far away from the real one, which is 03 ‎November ‎2015, ‏‎19:57:00

@ragdog: thanks, so explorer and winrar use the same method.

With regard to the screenshot below, Sherlock Holmes is convinced that the official Windows Explorer uses a function that has ­Tz in its name - Herge should know it  8)

nidud

  • Member
  • *****
  • Posts: 2304
    • https://github.com/nidud/asmc
Re: Check your file managers...!
« Reply #7 on: November 04, 2015, 07:15:20 AM »
Quote
Btw the creation date in attribute changer is far away from the real one, which is 03 November 2015, 19:57:00

That’s today.

Only modification time [24.05.12-01:00:00] is stored in the ZIP file. The time above is from decompression(?). Modification time then becomes [24.05.12-01:00:00] + local time (plus four hours apparently).

K_F

  • Member
  • *****
  • Posts: 1677
  • Anybody out there?
Re: Check your file managers...!
« Reply #8 on: November 04, 2015, 08:19:01 AM »
No problems here... could be that I disabled auto internet time sync service... or what ever it's called.
 ;)
'Sire, Sire!... the peasants are Revolting !!!'
'Yes, they are.. aren't they....'

jj2007

  • Member
  • *****
  • Posts: 11760
  • Assembler is fun ;-)
    • MasmBasic
Re: Check your file managers...!
« Reply #9 on: November 04, 2015, 08:58:40 AM »
Quote
Btw the creation date in attribute changer is far away from the real one, which is 03 November 2015, 19:57:00

That’s today.

Only modification time [24.05.12-01:00:00] is stored in the ZIP file. The time above is from decompression(?). Modification time then becomes [24.05.12-01:00:00] + local time (plus four hours apparently).

Oops :P

Yes of course :t

What about File Panel vs right-click in Explorer -> properties, both +1:00?

P.S.: After finding out that the mysterious bug affects even the command line DIR, a bit of googling revealed that Raymond Chen is aware of the problem: Why do Explorer and the command prompt interpret file times differently?

Quote
Explorer uses ... the time zone that was in effect at your current location at the time the timestamp was created
...
Why doesn't the command processor get with the program?

Well, for one thing, the people who decide what Explorer does are not the same people who decide what the command processor does. (The Explorer folks can certainly make suggestions, but they can't force the command processor to do anything.) It's like asking why Taco Bell puts the men's room on the left, but Pizza Hut puts it on the right.

The command processor is an old and cranky program. The command processor yells at Explorer to get off his lawn.

jj2007

  • Member
  • *****
  • Posts: 11760
  • Assembler is fun ;-)
    • MasmBasic
Re: Check your file managers...!
« Reply #10 on: November 06, 2015, 11:49:19 AM »
Update: MasmBasic version 6 November uses now, like Windows Explorer, the local time that was in place when the file was modified.

Example (comparing MasmBasic and DOS timestamps):

include \masm32\MasmBasic\MasmBasic.inc      ; download
  Init
  GetFiles \Masm32\examples\exampl01\comctls\*      ; create the Files$() array
  SortFiles              ; default: sort the Files$() array by date, most recent files first
  For_ ebx=0 To eax-1    ; print the results
      PrintLine Str$(GfSize(ebx)), Tb$, GfDate$(ebx), Spc2$, GfTime$(ebx), Tb$, Files$(ebx)
  Next
  Inkey Launch$("cmd /c dir /a-d /s /o-d \Masm32\examples\exampl01\comctls\*")
EndOfCode

Output:
5632    24.02.2015  17:36:34    \Masm32\examples\exampl01\comctls\comctls.exe
1020    24.02.2015  17:36:33    \Masm32\examples\exampl01\comctls\rsrc.res
12762   29.09.2011  03:08:15    \Masm32\examples\exampl01\comctls\comctls.asm
288     07.09.1998  14:17:58    \Masm32\examples\exampl01\comctls\rsrc.rc
766     07.09.1998  07:51:38    \Masm32\examples\exampl01\comctls\mainicon.ico

Directory ... \Masm32\examples\exampl01\comctls

24.02.15  17:36             5,632 comctls.exe
24.02.15  17:36             1,020 rsrc.res
29.09.11  02:08            12,762 comctls.asm
07.09.98  13:17               288 rsrc.rc
07.09.98  06:51               766 mainicon.ico


The wrong DOS times (in red) are all during summer daylight saving time.

More reading at The Old New Thing:
Why do Explorer and the command prompt interpret file times differently?
Converting from a UTC-based SYSTEMTIME directly to a local-time-based SYSTEMTIME

The second link explains the function that has Tz in its name :P

P.S.: Source & exe attached.