How to get modified date/time for a Windows file in D3

120 views
Skip to first unread message

frosty

unread,
Feb 7, 2024, 4:19:53 PMFeb 7
to Pick and MultiValue Databases
Is there a User Exit or similar to retrieve the last modified date/time (or the created date/time would work) of a file in a Windows directory that's pointed to by a D3 Q pointer?

I've got a Q pointer like this:
001 Q
002
003 DOS:C:/FolderName/SubFolderName
with a few thousand records that I'd like to SSELECT for processing by a BASIC routine.

Seems like this is something that might be baked into D3 but I can't find it. ¯\_(ツ)_/¯

Anybody know if this is a feature of D3?

philippe GRACIA

unread,
Feb 8, 2024, 5:38:13 AMFeb 8
to mvd...@googlegroups.com
hello.
maybe with a hdr qs pointer :
    dirfac1        
001 QS            
002                
003 hdr:c:/invoices


att3 Hexadecimal representation of the number of seconds elapsed since 12:00 AM December 31, 1967 and the time the item was last updated

list dirfac1 a3
dirfac1 a3.......
              
                 
.DS_Sto 69021F70
DIAZ_U7 699088F9
Futures 6ADDC945
Musique 69437658
To read 613106FA
wkhtmlt 54F978CB

you can also acces directly from tcl:

list dirfac1 hdr.date hdr.time

Page   1     dirfac1                
                                   
dirfac1 Time. Date......            
                                   
.DS_Sto 14:06   10/28/23            
DIAZ_U7 14:38   02/13/24            
Futures 09:17   10/23/24            
Musique 03:34   12/17/23            
To read 17:16   09/01/19            
wkhtmlt 09:52   03/04/13            
                                   
[405] 6 items listed out of 6 items.

works also on unix :)


--
You received this message because you are subscribed to
the "Pick and MultiValue Databases" group.
To post, email to: mvd...@googlegroups.com
To unsubscribe, email to: mvdbms+un...@googlegroups.com
For more options, visit http://groups.google.com/group/mvdbms
---
You received this message because you are subscribed to the Google Groups "Pick and MultiValue Databases" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mvdbms+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mvdbms/06f8db60-bec8-481f-9af5-e6f797fca206n%40googlegroups.com.

frosty

unread,
Feb 8, 2024, 10:14:58 AMFeb 8
to Pick and MultiValue Databases
Most excellent, Phillipe, thank you!


I will implement this today and test teh performance against the alternate solution I rigged yesterday.

Scott Ballinger

unread,
Feb 26, 2024, 7:53:34 PMFeb 26
to Pick and MultiValue Databases
Note that the hdr.date, hdr.time, etc info is available for regular D3 files as well, if you add the "yupt" processing code to the d-pointer attribute <8>.

I put these in the md:

:ct md hdr.date hdr.time hdr.user hdr.port

    hdr.date
001 a last update date for yupt hdr: lookup
002 3
003
004
005
006
007 d2-
008 a;3(mcxd)/"86400"
009 r
010 8

    hdr.time
001 a last update time for yupt hdr: lookup
002 3
003  hdr ]time
004
005
006
007 mt
008 a;r(3(mcxd),"86400")
009 r
010 5

    hdr.user
001 a last update user for yupt hdr: lookup
002 1
003 hdr]user
004
005
006
007
008
009 l
010 5

    hdr.port
001 a last update port for yupt hdr: lookup
002 2
003  hdr]port
004
005
006
007 mcxd
008
009 r
010 4

... then you can report the last time every item in a file was updated and by whom, e.g.

:list hdr:bp hdr.date hdr.time hdr.user hdr.port

I typically do this for the PROCs file (yes, still have lots of those) and the BP file.
Not sure what the overhead of the "yupt" processing code is on high volume transaction files?

/Scott Ballinger
Reply all
Reply to author
Forward
0 new messages