Posted by Grant Forakr on November 18, 2013 at 06:48:53:
Wrote a program over the weekend to rebuild a "totalled" DocMgr archive. All the PDF's were fine. I wanted to recover as much of the original info as possible. Wrote the following to get the Date/Time.
================================================================
GetDateTime:
EXTRACT (7,2670) KEY = '*DIR'
LET ZSORT = ZSORT + 1
WRITE (7,2670) KEY = '*DIR'
LET TOFILE$ = '~' + STRIP(STR(ZSORT)) + '.PDF'
CREATE TOFILE$, DIR = 'TMP', EXCP = GDT90
LET FROMJOBNAME$ = STRIP(WPATH$) + FILENAME$
LET TMPJOBNAME$ = '$(CATEMP)\' + TOFILE$ ! DESTINATION NAME ON TMP DIRECTORY
LET FLAGS = 0 + 0 + 0 + 2048 ! SOURCE CAW, DEST CAW, PROG BAR, OVERWRITE
Print (CopyFile = FROMJOBNAME$, TMPJOBNAME$, FLAGS) ! COPY TO TMP DIRECTORY
GOSUB GetResult
IF FuncError NE 1
LET MBMSG$ = 'Copy Error:' + STR(FuncError) + '/' + STR(FileError)
LET MBMSG$ = MBMSG$ + '@0D0A@From: ' + STRIP(FROMJOBNAME$)
LET MBMSG$ = MBMSG$ + '@0D0A@To: ' + STRIP(TMPJOBNAME$)
MSGBOX(MBMSG$)
GOTO ProgExit
ENDIF
LET FSTAT$ = FSTAT(TOFILE$, DIR = 'TMP')
LET JobDate$ = SUB(FSTAT$,74,4) + SUB(FSTAT$,70,4)
LET JobTime$ = SUB(FSTAT$,131,4) + SUB(FSTAT$,129,2)
ERASE TOFILE$, DIR = 'TMP', EXCP = GDT90
GDT90:
RETURN
Each file can be a maximum of 1MB in length Uploaded files will be purged from the server on a regular basis.