Click here to Skip to main content
15,887,214 members

The Weird and The Wonderful

   

The Weird and The Wonderful forum is a place to post Coding Horrors, Worst Practices, and the occasional flash of brilliance.

We all come across code that simply boggles the mind. Lazy kludges, embarrassing mistakes, horrid workarounds and developers just not quite getting it. And then somedays we come across - or write - the truly sublime.

Post your Best, your worst, and your most interesting. But please - no programming questions . This forum is purely for amusement and discussions on code snippets. All actual programming questions will be removed.

 
GeneralTime Stamps Rendered by CMD.exe Pin
David A. Gray13-May-18 19:43
David A. Gray13-May-18 19:43 
GeneralRe: Time Stamps Rendered by CMD.exe Pin
Jochen Arndt13-May-18 20:56
professionalJochen Arndt13-May-18 20:56 
GeneralRe: Time Stamps Rendered by CMD.exe Pin
David A. Gray14-May-18 10:17
David A. Gray14-May-18 10:17 
GeneralRe: Time Stamps Rendered by CMD.exe Pin
Jochen Arndt14-May-18 12:12
professionalJochen Arndt14-May-18 12:12 
GeneralRe: Time Stamps Rendered by CMD.exe Pin
David A. Gray16-May-18 6:58
David A. Gray16-May-18 6:58 
GeneralRe: Time Stamps Rendered by CMD.exe Pin
Randor 14-May-18 16:58
professional Randor 14-May-18 16:58 
GeneralRe: Time Stamps Rendered by CMD.exe Pin
David A. Gray16-May-18 6:30
David A. Gray16-May-18 6:30 
GeneralRe: Time Stamps Rendered by CMD.exe Pin
Randor 16-May-18 16:01
professional Randor 16-May-18 16:01 
David A. Gray wrote:
So far, I've tested the stat() function, as implemented in Perl and PHP. Next come JavaScript, in the Node CLI, and VBScript, and, finally, PowerShell, which I anticipate will mirror the C# program that put the nail in the coffin. Now that I've learned all this, I think the resulting article will be a third installment in the Time Zone Lab series that I started a couple of years ago.


I expect that you will get the same results from Perl, PHP, Javascript, VBScript because all of those high-level languages will call into the GetFileAttributesEx Windows API to get file time stamps.

The C lib function _stat() and all 32 bit variants are forwarded to GetFileAttributes
The C lib function _stat64() and all 64 bit variants functions are forwarded to GetFileAttributesEx.
GetFileAttributes simply forwards to GetFileAttributesEx

Finally... GetFileAttributeEx calls into the NtQueryAttributesFile function[^] via a SYSCALL and then in kernelmode the request walks it's way through the filter drivers down to the filesystem driver.

You are basically testing NtQueryAttributesFile function multiple times from the Thirteenth Floor.

Those high level languages may format the date differently... but they are all getting the same timestamp from the filesystem layer.

Best Wishes,
-David Delaune
GeneralRe: Time Stamps Rendered by CMD.exe Pin
David A. Gray17-May-18 4:44
David A. Gray17-May-18 4:44 
GeneralRe: Time Stamps Rendered by CMD.exe Pin
Randor 17-May-18 10:01
professional Randor 17-May-18 10:01 
GeneralRe: Time Stamps Rendered by CMD.exe Pin
DaveAuld19-May-18 21:37
professionalDaveAuld19-May-18 21:37 
GeneralRe: Time Stamps Rendered by CMD.exe Pin
David A. Gray21-May-18 7:15
David A. Gray21-May-18 7:15 
GeneralSunday morning, and Microsoft has rebooted my laptop... Pin
charlieg13-May-18 2:46
charlieg13-May-18 2:46 
GeneralRe: Sunday morning, and Microsoft has rebooted my laptop... Pin
Slacker00713-May-18 3:11
professionalSlacker00713-May-18 3:11 
GeneralRe: Sunday morning, and Microsoft has rebooted my laptop... Pin
raddevus13-May-18 3:31
mvaraddevus13-May-18 3:31 
GeneralRe: Sunday morning, and Microsoft has rebooted my laptop... Pin
charlieg13-May-18 3:58
charlieg13-May-18 3:58 
GeneralRe: Sunday morning, and Microsoft has rebooted my laptop... Pin
raddevus13-May-18 5:02
mvaraddevus13-May-18 5:02 
GeneralRe: Sunday morning, and Microsoft has rebooted my laptop... Pin
Randor 13-May-18 15:17
professional Randor 13-May-18 15:17 
GeneralRe: Sunday morning, and Microsoft has rebooted my laptop... Pin
raddevus13-May-18 17:03
mvaraddevus13-May-18 17:03 
GeneralRe: Sunday morning, and Microsoft has rebooted my laptop... Pin
Slacker00713-May-18 4:08
professionalSlacker00713-May-18 4:08 
GeneralRe: Sunday morning, and Microsoft has rebooted my laptop... Pin
raddevus13-May-18 5:05
mvaraddevus13-May-18 5:05 
GeneralRe: Sunday morning, and Microsoft has rebooted my laptop... Pin
kmoorevs14-May-18 4:54
kmoorevs14-May-18 4:54 
GeneralRe: Sunday morning, and Microsoft has rebooted my laptop... Pin
raddevus14-May-18 5:20
mvaraddevus14-May-18 5:20 
GeneralRe: Sunday morning, and Microsoft has rebooted my laptop... Pin
charlieg13-May-18 3:54
charlieg13-May-18 3:54 
GeneralRe: Sunday morning, and Microsoft has rebooted my laptop... Pin
Slacker00713-May-18 4:06
professionalSlacker00713-May-18 4:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.